@@ -4,14 +4,9 @@ name: Publish to ghcr
44# @ see: https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners
55
66on :
7- # schedule:
8- # - cron: '18 10 * * *'
97 push :
108 branches : ["main"]
11- # Publish semver tags as releases.
129 tags : ["v*.*.*"]
13- pull_request :
14- branches : ["main"]
1510
1611env :
1712 # Use docker.io for Docker Hub if empty
3025 matrix :
3126 platform :
3227 - linux/amd64
28+ - linux/arm/v6
29+ - linux/arm/v7
3330 - linux/arm64
3431
3532 steps :
5451 # Install the cosign tool except on PR
5552 # https://github.com/sigstore/cosign-installer
5653 - name : Install cosign
57- if : github.event_name != 'pull_request'
5854 uses : sigstore/cosign-installer@v3.5.0
5955 with :
6056 cosign-release : " v2.2.4"
@@ -64,17 +60,17 @@ jobs:
6460
6561 - name : Login to GitHub Packages Docker Registry
6662 uses : docker/login-action@v3
67- if : github.event_name != 'pull_request'
6863 with :
6964 registry : ghcr.io
7065 username : ${{ github.actor }}
7166 password : ${{ secrets.GITHUB_TOKEN }}
7267
73- - name : Build and push Docker image
68+ - name : Build Docker image
7469 id : build
7570 uses : docker/build-push-action@v6
7671 with :
7772 context : .
73+ tags : ${{ steps.meta.outputs.tags }}
7874 labels : ${{ steps.meta.outputs.labels }}
7975 cache-from : type=gha
8076 cache-to : type=gha,mode=max
10197 # transparency data even for private images, pass --force to cosign below.
10298 # https://github.com/sigstore/cosign
10399 - name : Sign the published Docker image
104- if : ${{ github.event_name != 'pull_request' }}
105100 env :
106101 # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
107102 TAGS : ${{ steps.meta.outputs.tags }}
@@ -114,7 +109,6 @@ jobs:
114109 runs-on : ubuntu-latest
115110 permissions :
116111 packages : write
117- if : github.event_name != 'pull_request'
118112 needs :
119113 - build
120114 steps :
0 commit comments