Skip to content

Commit

Permalink
feat(build): add image signing GH action (#82)
Browse files Browse the repository at this point in the history
Signed-off-by: Ramiz Polic <[email protected]>
  • Loading branch information
ramizpolic authored Jun 7, 2024
1 parent 6834eb7 commit 44e97a5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0

- name: Set up Cosign
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5.0

- name: Set image name
id: image-name
run: echo "value=ghcr.io/${{ github.repository }}" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -114,6 +117,18 @@ jobs:
outputs: ${{ steps.build-output.outputs.value }}
# push: ${{ inputs.publish }}

- name: Sign image with GitHub OIDC Token
if: inputs.publish
env:
DIGEST: ${{ steps.build.outputs.digest }}
TAGS: ${{ steps.meta.outputs.tags }}
run: |
images=""
for tag in ${TAGS}; do
images+="${tag}@${DIGEST} "
done
cosign sign --yes ${images}
- name: Set image ref
id: image-ref
run: echo "value=${{ steps.image-name.outputs.value }}@${{ steps.build.outputs.digest }}" >> "$GITHUB_OUTPUT"
Expand Down

0 comments on commit 44e97a5

Please sign in to comment.