Skip to content

Commit

Permalink
Update docker-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
martijndeb authored Jan 5, 2024
1 parent 71b1587 commit e329be4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ jobs:
id: build-and-push
run: |
docker-compose build
DOCKER_OUTPUT=$(docker-compose push)
echo "${DOCKER_OUTPUT}"
DIGEST=$(echo "${DOCKER_OUTPUT}" | grep -oP '(?<=digest: ).*')
echo "DIGEST=${DIGEST}" >> $GITHUB_ENV
DOCKER_IMAGE=$(docker-compose images --format "{{.Repository}}:{{.Tag}}")
docker-compose push
env:
DOCKER_BUILDKIT: 1

- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ env.DIGEST }}
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
run: |
for tag in ${TAGS}; do
cosign sign --key /path/to/your/private-key.key --skopeo-repo docker://${DOCKER_IMAGE}:${tag} --upload-signature
done

0 comments on commit e329be4

Please sign in to comment.