@@ -2,10 +2,10 @@ name: Docker
22
33on :
44 push :
5- branches : [ "main" ]
6- tags : [ ' v*.*.*' ]
5+ branches : ["main"]
6+ tags : [" v*.*.*" ]
77 pull_request :
8- branches : [ "main" ]
8+ branches : ["main"]
99
1010env :
1111 REGISTRY : ghcr.io
@@ -17,56 +17,44 @@ jobs:
1717 permissions :
1818 contents : read
1919 packages : write
20- id-token : write
2120
2221 steps :
2322 - name : Checkout repository
2423 uses : actions/checkout@v4
2524
26- - name : Install cosign
27- if : github.event_name != 'pull_request'
28- uses : sigstore/cosign-installer@v3.3.0
29- with :
30- cosign-release : ' v2.2.3'
25+ - name : Set up QEMU
26+ uses : docker/setup-qemu-action@v3
3127
3228 - name : Set up Docker Buildx
33- uses : docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
29+ uses : docker/setup-buildx-action@v3
3430
3531 - name : Log into registry ${{ env.REGISTRY }}
3632 if : github.event_name != 'pull_request'
37- uses : docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
33+ uses : docker/login-action@v3
3834 with :
3935 registry : ${{ env.REGISTRY }}
4036 username : ${{ github.actor }}
4137 password : ${{ secrets.GITHUB_TOKEN }}
4238
4339 - name : Extract Docker metadata
4440 id : meta
45- uses : docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
41+ uses : docker/metadata-action@v5
4642 with :
4743 images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4844 tags : |
4945 type=sha,enable=true,priority=100,prefix=sha-,suffix=,format=short
50- type=raw,value=latest
51-
52- - uses : depot/setup-action@v1
46+ type=raw,value=latest,enable={{is_default_branch}}
47+ type=semver,pattern={{version}}
48+ type=semver,pattern={{major}}.{{minor}}
5349
5450 - name : Build and push Docker image
55- id : build-and-push
56- uses : depot/build-push-action@v1
51+ uses : docker/build-push-action@v6
5752 with :
5853 context : " crates"
5954 file : " crates/Dockerfile"
6055 push : ${{ github.event_name != 'pull_request' }}
6156 tags : ${{ steps.meta.outputs.tags }}
6257 labels : ${{ steps.meta.outputs.labels }}
63- platforms : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'drifting-in-space/plane' && 'linux/amd64' || 'linux/amd64,linux/arm64' }}
64- buildx-fallback : true
65- project : 58j0517pw2
66-
67- - name : Sign the published Docker image
68- if : ${{ github.event_name != 'pull_request' }}
69- env :
70- TAGS : ${{ steps.meta.outputs.tags }}
71- DIGEST : ${{ steps.build-and-push.outputs.digest }}
72- run : echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
58+ platforms : linux/amd64,linux/arm64
59+ cache-from : type=gha
60+ cache-to : type=gha,mode=max
0 commit comments