-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Justin Pflueger <[email protected]>
- Loading branch information
Showing
1 changed file
with
9 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,12 +23,11 @@ jobs: | |
id-token: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
# Install the cosign tool except on PR | ||
# https://github.com/sigstore/cosign-installer | ||
- name: Install cosign | ||
if: github.event_name != 'pull_request' | ||
uses: sigstore/[email protected] | ||
|
||
- name: Set up QEMU | ||
|
@@ -66,11 +65,16 @@ jobs: | |
skipContainerUserIdUpdate: true | ||
platform: linux/amd64,linux/arm64 | ||
runCmd: spin --version | ||
push: always | ||
|
||
# Sign the resulting Docker image digest except on PRs. | ||
- name: Sign the published Docker image | ||
if: ${{ github.event_name != 'pull_request' }} | ||
env: | ||
IMAGE: ghcr.io/${{ github.repository }} | ||
TAGS: ${{ steps.meta.outputs.tags }} | ||
DIGEST: ${{ steps.build-and-push.outputs.digest }} | ||
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} | ||
run: | | ||
for tag in "${TAGS[@]}"; do | ||
IMAGE_TAG="ghcr.io/${IMAGE}:${tag}" | ||
DIGEST=$(docker image ls "$IMAGE_TAG" --digests --format='{{.Digest}}') | ||
cosign sign --yes "${IMAGE_TAG}@${DIGEST}" | ||
done |