5656 docker :
5757 name : 🐳 Build & Push Docker
5858 runs-on : ubuntu-latest
59- needs : release
60- if : needs.release.outputs.release_created == 'true '
59+ needs : test
60+ if : github.ref == 'refs/heads/main '
6161 permissions :
6262 contents : read
6363 packages : write
6767 steps :
6868 - name : Checkout repository
6969 uses : actions/checkout@v4
70- with :
71- ref : ${{ needs.release.outputs.tag }}
7270
7371 - name : Set up Docker Buildx
7472 uses : docker/setup-buildx-action@v3
8684 with :
8785 images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
8886 tags : |
89- type=semver,pattern={{version}},value=${{ needs.release.outputs.tag }}
90- type=semver,pattern={{major}}.{{minor}},value=${{ needs.release.outputs.tag }}
91- type=semver,pattern={{major}},value=${{ needs.release.outputs.tag }}
87+ type=ref,event=branch
88+ type=sha,prefix={{branch}}-
9289 type=raw,value=latest
9390
9491 - name : Build and push Docker image
@@ -101,10 +98,9 @@ jobs:
10198 platforms : linux/amd64,linux/arm64
10299 cache-from : type=gha
103100 cache-to : type=gha,mode=max
104- build-args : |
105- VERSION=${{ needs.release.outputs.tag }}
106101
107102 - name : Generate artifact attestation
103+ id : build
108104 uses : actions/attest-build-provenance@v1
109105 with :
110106 subject-name : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
0 commit comments