Skip to content

Commit 77a1ee7

Browse files
committed
ci: attempt to fix DCT key
1 parent 5f77e53 commit 77a1ee7

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

.github/workflows/build-publish-signed.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@ jobs:
2424
- name: Load DCT delegation key
2525
env:
2626
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ secrets.DCT_KEY_PASSPHRASE }}
27-
DCT_KEY_BASE64: ${{ secrets.DCT_KEY_BASE64 }}
27+
DCT_KEY_PATH: ~/.docker/trust/private/${{ vars.DCT_KEY_ID }}.key
2828
run: |
29-
echo "$DCT_KEY_BASE64" | base64 -d > delegation.key
30-
chmod 600 delegation.key
31-
docker trust key load delegation.key --name gha
29+
mkdir -pv ~/.docker/trust/private
30+
ls -la ~/.docker/trust/private
31+
echo "${{ secrets.DCT_KEY_BASE64 }}" | base64 -d > delegation.key
32+
mv -fv delegation.key "$DCT_KEY_PATH"
33+
chmod 600 "$DCT_KEY_PATH"
34+
docker trust key load "$DCT_KEY_PATH" --name gha
3235
3336
- name: Login to DockerHub
3437
uses: docker/login-action@v3
@@ -50,4 +53,7 @@ jobs:
5053
docker trust inspect --pretty ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
5154
5255
- name: Remove DCT delegation key
53-
run: rm delegation.key
56+
env:
57+
DCT_KEY_PATH: ~/.docker/trust/private/${{ vars.DCT_KEY_ID }}.key
58+
run: |
59+
rm "$DCT_KEY_PATH"

0 commit comments

Comments
 (0)