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 368b1d5 commit 0c2dc83
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ jobs:

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0


- name: Install skopeo and jq
run: |
sudo apt-get update && sudo apt-get install -y skopeo jq
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
Expand All @@ -56,11 +60,14 @@ jobs:
docker-compose build
DOCKER_IMAGE=$(docker-compose images --format "{{.Repository}}:{{.Tag}}")
docker-compose push
DIGEST=$(skopeo inspect docker://${DOCKER_IMAGE} | jq -r '.Digest')
echo "DIGEST=${DIGEST}" >> $GITHUB_ENV
env:
DOCKER_BUILDKIT: 1

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

0 comments on commit 0c2dc83

Please sign in to comment.