Skip to content

Commit

Permalink
ci: attempt to fix DCT key
Browse files Browse the repository at this point in the history
  • Loading branch information
buchdag committed May 17, 2024
1 parent 5f77e53 commit fd3ef70
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/build-publish-signed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ jobs:
env:
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ secrets.DCT_KEY_PASSPHRASE }}
DCT_KEY_BASE64: ${{ secrets.DCT_KEY_BASE64 }}
DCT_KEY_ID: ${{ secrets.DCT_KEY_ID }}
run: |
echo "$DCT_KEY_BASE64" | base64 -d > delegation.key
chmod 600 delegation.key
docker trust key load delegation.key --name gha
export DCT_KEY_PATH="$(echo "~/.docker/trust/private/${DCT_KEY_ID}.key")"
mkdir -p ~/.docker/trust/private
echo "$DCT_KEY_BASE64" | base64 -d > "$DCT_KEY_PATH"
chmod 600 "$DCT_KEY_PATH"
docker trust key load "$DCT_KEY_PATH" --name gha
- name: Login to DockerHub
uses: docker/login-action@v3
Expand All @@ -50,4 +53,8 @@ jobs:
docker trust inspect --pretty ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
- name: Remove DCT delegation key
run: rm delegation.key
env:
DCT_KEY_ID: ${{ secrets.DCT_KEY_ID }}
run: |
export DCT_KEY_PATH="$(echo "~/.docker/trust/private/${DCT_KEY_ID}.key")"
rm "$DCT_KEY_PATH"

0 comments on commit fd3ef70

Please sign in to comment.