Skip to content

Commit 44e97a5

Browse files
authored
feat(build): add image signing GH action (#82)
Signed-off-by: Ramiz Polic <ramiz.polic@hotmail.com>
1 parent 6834eb7 commit 44e97a5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/artifacts.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ jobs:
6666
- name: Set up Docker Buildx
6767
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
6868

69+
- name: Set up Cosign
70+
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5.0
71+
6972
- name: Set image name
7073
id: image-name
7174
run: echo "value=ghcr.io/${{ github.repository }}" >> "$GITHUB_OUTPUT"
@@ -114,6 +117,18 @@ jobs:
114117
outputs: ${{ steps.build-output.outputs.value }}
115118
# push: ${{ inputs.publish }}
116119

120+
- name: Sign image with GitHub OIDC Token
121+
if: inputs.publish
122+
env:
123+
DIGEST: ${{ steps.build.outputs.digest }}
124+
TAGS: ${{ steps.meta.outputs.tags }}
125+
run: |
126+
images=""
127+
for tag in ${TAGS}; do
128+
images+="${tag}@${DIGEST} "
129+
done
130+
cosign sign --yes ${images}
131+
117132
- name: Set image ref
118133
id: image-ref
119134
run: echo "value=${{ steps.image-name.outputs.value }}@${{ steps.build.outputs.digest }}" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)