Skip to content

Commit

Permalink
Add cosign of image (experimental)
Browse files Browse the repository at this point in the history
  • Loading branch information
leojonathanoh committed Mar 3, 2023
1 parent b94c9e0 commit 73df0e2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:
permissions:
contents: read
packages: write
# This is required for requesting the JWT (need for cosign)
id-token: write

jobs:
# This job builds the binaries and uploads it as github artifacts.
Expand Down Expand Up @@ -117,6 +119,9 @@ jobs:
- run: |
ls -al release*/
- name: Install cosign
uses: sigstore/cosign-installer@c3667d99424e7e6047999fb6246c0da843953c65 # v3.0.1

- name: Build and push
id: build-and-push
# TODO: Remove pull_request before merging
Expand All @@ -133,6 +138,10 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: Sign the published Docker image
# if: ${{ github.event_name != 'pull_request' }}
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign --yes {}@${{ steps.build-and-push.outputs.digest }}

# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
Expand Down

0 comments on commit 73df0e2

Please sign in to comment.