File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 99 push_images :
1010 name : Test and Push Images
1111 runs-on : ubuntu-latest
12+ permissions :
13+ id-token : write # needed for signing the images with GitHub OIDC Token
1214 strategy :
1315 matrix :
1416 # "{0}" will be replaced by the latest pushed nginx version
4446 nginx-tag : " ${{ steps.target_nginx_tag.outputs.tag }}"
4547 matrix-nginx : " ${{ matrix.nginx }}"
4648 docker-repository : " ${{ vars.DOCKER_REPOSITORY }}"
49+ - name : Install Cosign
50+ uses : sigstore/cosign-installer@v3
4751 - uses : docker/setup-qemu-action@v3
4852 name : Set up QEMU
4953 - uses : docker/setup-buildx-action@v3
5559 password : ${{ secrets.DOCKER_PASSWORD }}
5660 - uses : docker/build-push-action@v6
5761 name : Build and push
62+ id : build-and-push
5863 if : ${{ steps.target_tags.outputs.tags != '' }}
5964 with :
6065 context : .
6570 build-args : NGINX_TAG=${{ steps.target_nginx_tag.outputs.tag }}
6671 provenance : mode=max
6772 sbom : true
73+ - name : Sign the images with GitHub OIDC Token
74+ if : ${{ steps.target_tags.outputs.tags != '' }}
75+ env :
76+ DIGEST : ${{ steps.build-and-push.outputs.digest }}
77+ TAGS : ${{ steps.target_tags.outputs.tags }}
78+ run : |
79+ images=""
80+ for tag in ${TAGS//,/ }; do
81+ images+="${tag}@${DIGEST} "
82+ done
83+ echo '${{ secrets.DOCKER_PASSWORD }}' | cosign login ${{ vars.HELM_REGISTRY }} --username '${{ secrets.DOCKER_USERNAME }}' --password-stdin
84+ cosign sign --yes ${images}
Original file line number Diff line number Diff line change 1111 rebase_images :
1212 name : Update Images
1313 runs-on : ubuntu-latest
14+ permissions :
15+ id-token : write # needed for signing the images with GitHub OIDC Token
1416 strategy :
1517 matrix :
1618 spa_server_major_version : [ "latest", "1" ]
8183 password : ${{ secrets.DOCKER_PASSWORD }}
8284 - uses : docker/build-push-action@v6
8385 name : Build and push
86+ id : build-and-push
8487 if : ${{ steps.check_if_update_is_necessary.outputs.needs_update == 'true' && steps.target_image_name.outputs.tags != '' }}
8588 with :
8689 context : .
9194 build-args : NGINX_TAG=${{ steps.target_nginx_tag.outputs.tag }}
9295 provenance : mode=max
9396 sbom : true
97+ - name : Sign the images with GitHub OIDC Token
98+ if : ${{ steps.target_tags.outputs.tags != '' }}
99+ env :
100+ DIGEST : ${{ steps.build-and-push.outputs.digest }}
101+ TAGS : ${{ steps.target_image_name.outputs.tags }}
102+ run : |
103+ images=""
104+ for tag in ${TAGS//,/ }; do
105+ images+="${tag}@${DIGEST} "
106+ done
107+ echo '${{ secrets.DOCKER_PASSWORD }}' | cosign login ${{ vars.HELM_REGISTRY }} --username '${{ secrets.DOCKER_USERNAME }}' --password-stdin
108+ cosign sign --yes ${images}
You can’t perform that action at this time.
0 commit comments