Repository navigation
66 lines (55 loc) · 2.61 KB
/
Copy pathdocker.yml
File metadata and controls
66 lines (55 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Docker
on: [pull_request, push]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
docker:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login
runs-on: ubuntu-26.04
permissions:
contents: read
packages: write
steps:
- uses: docker/metadata-action@v6
id: meta
with:
images: |
motioneyeproject/motioneye
ghcr.io/${{ github.repository_owner }}/motioneye
flavor: latest=false
tags: |
type=edge,branch=dev
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=match,pattern=\d+\.\d+\.\d+b\d+
type=raw,value=beta,enable=${{ github.ref_type == 'tag' && contains(github.ref_name, 'b') && contains(github.ref_name, '.') && !startsWith(github.ref_name, 'v') && !contains(github.ref_name, '-') }}
type=raw,value=latest,enable=${{ github.ref_type == 'tag' && !contains(github.ref_name, 'b') && contains(github.ref_name, '.') && !startsWith(github.ref_name, 'v') && !contains(github.ref_name, '-') }}
- uses: docker/setup-qemu-action@v4
with:
cache-image: false
- uses: docker/setup-buildx-action@v4
- name: Login to Docker Hub
uses: docker/login-action@v4
if: github.event_name == 'push' && github.repository == 'motioneye-project/motioneye' && steps.meta.outputs.tags != null
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
if: github.event_name == 'push' && github.repository == 'motioneye-project/motioneye' && steps.meta.outputs.tags != null
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/build-push-action@v7
with:
file: ./docker/Dockerfile
# linux/loong64 from Debian Forky on
# linux/arm/v6 builds times out after 6h, due to heavy compiling the "cmake" Python module, skipping it
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/riscv64,linux/ppc64le,linux/s390x
push: ${{ github.event_name == 'push' && github.repository == 'motioneye-project/motioneye' && steps.meta.outputs.tags != null }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}