Skip to content

Commit 9e53c09

Browse files
updated to resolve signing issue.
1 parent 03089e6 commit 9e53c09

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

.github/workflows/docker-release.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,30 @@ jobs:
5757
type=semver,pattern={{version}}
5858
type=semver,pattern={{major}}.{{minor}}
5959
latest
60-
60+
6161
- name: Login to DockerHub
6262
uses: docker/login-action@v2
6363
with:
6464
username: ${{ secrets.DOCKERHUB_USERNAME }}
6565
password: ${{ secrets.DOCKERHUB_TOKEN }}
6666

67-
- name: Build and push Docker image (with signing)
67+
- name: Build Docker image (without pushing)
6868
uses: docker/build-push-action@v4
69-
env:
70-
DOCKER_CONTENT_TRUST: 1
71-
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{secrets.DIGICERT_PKEY_PASSPHRASE}}
72-
DOCKER_CONTENT_TRUST_KEY_FILENAME: ${{secrets.DIGICERT_PKEY_FILENAME}}
73-
DOCKER_CONTENT_TRUST_PKEY_ROLE: ${{secrets.DIGICERT_PKEY_ROLE}}
7469
with:
7570
context: .
76-
push: true
71+
push: false
72+
load: true
7773
tags: ${{ steps.meta.outputs.tags }}
7874
labels: ${{ steps.meta.outputs.labels }}
7975
cache-from: type=gha
8076
cache-to: type=gha,mode=max
77+
78+
- name: Push and sign Docker image with DCT
79+
run: |
80+
# Parse the tags from metadata output
81+
IFS=',' read -ra TAGS <<< "${{ steps.meta.outputs.tags }}"
82+
# Push each tag with Docker Content Trust enabled
83+
for tag in "${TAGS[@]}"; do
84+
echo "Pushing and signing $tag"
85+
docker push $tag
86+
done

0 commit comments

Comments
 (0)