-
-
Notifications
You must be signed in to change notification settings - Fork 168
60 lines (56 loc) · 1.87 KB
/
docker.yml
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
name: Docker image build and push
on:
push:
branches:
- 'master'
schedule:
- cron: '0 0 * * *'
permissions:
contents: read
jobs:
docker:
permissions:
deployments: write # Docker needs to be able to deploy and package.
packages: write
if: github.repository == 'brainboxdotcc/DPP'
runs-on: ubuntu-latest
concurrency:
group: docker-deployment
cancel-in-progress: false
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
with:
egress-policy: audit
-
name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1 # v2.9.1
-
name: Login to DockerHub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
with:
push: true
tags: brainboxdotcc/dpp
- # copy multiplatform image from dockerhub to ghcr
name: Push Image to multiple registries
uses: akhilerm/tag-push-action@85bf542f43f5f2060ef76262a67ee3607cb6db37 # v2.1.0
with:
src: docker.io/brainboxdotcc/dpp:latest
dst: |
ghcr.io/brainboxdotcc/dpp:latest