File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,14 @@ concurrency:
1414
1515permissions :
1616 contents : read
17- packages : write
1817
1918jobs :
2019 build-and-push :
2120 name : Build and Push (${{ matrix.image }})
2221 runs-on : ubuntu-latest
22+ permissions :
23+ packages : write
24+ id-token : write
2325 strategy :
2426 matrix :
2527 image : [
3840 - name : Checkout code
3941 uses : actions/checkout@v4
4042
43+ - name : Install cosign
44+ if : github.event_name != 'pull_request'
45+ uses : sigstore/cosign-installer@v3
46+ with :
47+ cosign-release : ' v2.5.3'
48+
4149 - name : Set up Docker Buildx
4250 uses : docker/setup-buildx-action@v3
4351
6977 echo "ERROR: failed to determine image tag"
7078 exit 1
7179 fi
72- echo "TAG_NAME= $tag" >> $GITHUB_ENV
80+ echo "TAG=ghcr.io/${{ github.repository }}/plugins/${{ matrix.image }}: $tag" >> $GITHUB_ENV
7381
7482 - name : Build and push image
83+ id : build-and-push
7584 uses : docker/build-push-action@v6
7685 with :
7786 context : .
8089 PLUGIN=${{ matrix.image }}
8190 push : ${{ github.event_name == 'push' }}
8291 platforms : ${{ github.event_name == 'push' && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
83- tags : ghcr.io/${{ github.repository }}/plugins/${{ matrix.image }}:${{ env.TAG_NAME }}
92+ tags : ${{ env.TAG }}
93+
94+ - name : Sign image
95+ if : ${{ github.event_name != 'pull_request' }}
96+ env :
97+ DIGEST : ${{ steps.build-and-push.outputs.digest }}
98+ run : cosign sign --yes ${{ env.TAG }}@${DIGEST}
You can’t perform that action at this time.
0 commit comments