File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ name: Publish
33on :
44 push :
55 branches : [main]
6+ tags : [v*]
67 pull_request :
78
89env :
2122 attestations : write
2223 id-token : write
2324 steps :
25+ - name : Install Cosign
26+ 2427 - name : Checkout
2528 uses : actions/checkout@v4
2629 with :
@@ -36,12 +39,25 @@ jobs:
3639 id : meta
3740 with :
3841 images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
42+ tags : |
43+ type=ref,event=branch
44+ type=ref,event=pr
45+ type=semver,pattern={{version}}
46+ type=semver,pattern={{major}}.{{minor}}
47+ type=sha
3948 - name : Build and push
4049 uses : docker/build-push-action@v4
50+ id : build-and-push
4151 with :
4252 context : .
4353 push : ${{ github.event_name != 'pull_request' }}
4454 tags : ${{ steps.meta.outputs.tags }}
4555 labels : ${{ steps.meta.outputs.labels }}
4656 cache-from : type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4757 cache-to : type=inline
58+ - name : Sign the published Docker image
59+ if : ${{ github.event_name != 'pull_request' }}
60+ env :
61+ TAGS : ${{ steps.meta.outputs.tags }}
62+ DIGEST : ${{ steps.build-and-push.outputs.digest }}
63+ run : echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
You can’t perform that action at this time.
0 commit comments