-
Notifications
You must be signed in to change notification settings - Fork 3
47 lines (41 loc) · 1.4 KB
/
docker-publish.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
name: Create and publish a Docker image to GHCR
on:
push: {}
workflow_dispatch: {}
env:
REGISTRY: ghcr.io
PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6,linux/386,linux/ppc64le,linux/s390x
BUILDX_NO_DEFAULT_ATTESTATIONS: 1
permissions:
contents: read
packages: write
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build and push Docker image (worker)
uses: mr-smithers-excellent/docker-build-push@v6
with:
image: ${{ github.event.repository.name }}-worker
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
multiPlatform: true
platform: ${{ env.PLATFORMS }}
directory: worker
dockerfile: worker/Dockerfile
addLatest: ${{ github.ref_name == 'main' }}
- name: Build and push Docker image (nginx)
uses: mr-smithers-excellent/docker-build-push@v6
with:
image: ${{ github.event.repository.name }}-nginx
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
multiPlatform: true
platform: ${{ env.PLATFORMS }}
directory: nginx
dockerfile: nginx/Dockerfile
addLatest: ${{ github.ref_name == 'main' }}