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 88
99permissions :
1010 contents : read
11+ id-token : write # needed for signing the images with GitHub OIDC Token
1112
1213jobs :
1314 build :
1415 runs-on : ubuntu-latest
1516 steps :
17+ - name : Install Cosign
18+ uses : sigstore/cosign-installer@v3
19+
1620 - name : Log in to DockerHub
1721 uses : docker/login-action@v2
1822 with :
@@ -29,10 +33,22 @@ jobs:
2933 type=pep440,pattern={{raw}}
3034
3135 - name : Build and push all platforms
36+ id : build-and-push
3237 uses : docker/build-push-action@v3
3338 with :
3439 push : true
3540 labels : " gitsha1=${{ github.sha }}"
3641 tags : " ${{ steps.set-tag.outputs.tags }}"
3742 file : " docker/Dockerfile"
3843 platforms : linux/amd64
44+
45+ - name : Sign the images with GitHub OIDC Token
46+ env :
47+ DIGEST : ${{ steps.build-and-push.outputs.digest }}
48+ TAGS : ${{ steps.set-tag.outputs.tags }}
49+ run : |
50+ images=""
51+ for tag in ${TAGS}; do
52+ images+="${tag}@${DIGEST} "
53+ done
54+ cosign sign --yes ${images}
You can’t perform that action at this time.
0 commit comments