File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -57,24 +57,30 @@ jobs:
57
57
type=semver,pattern={{version}}
58
58
type=semver,pattern={{major}}.{{minor}}
59
59
latest
60
-
60
+
61
61
- name : Login to DockerHub
62
62
uses : docker/login-action@v2
63
63
with :
64
64
username : ${{ secrets.DOCKERHUB_USERNAME }}
65
65
password : ${{ secrets.DOCKERHUB_TOKEN }}
66
66
67
- - name : Build and push Docker image (with signing )
67
+ - name : Build Docker image (without pushing )
68
68
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}}
74
69
with :
75
70
context : .
76
- push : true
71
+ push : false
72
+ load : true
77
73
tags : ${{ steps.meta.outputs.tags }}
78
74
labels : ${{ steps.meta.outputs.labels }}
79
75
cache-from : type=gha
80
76
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
You can’t perform that action at this time.
0 commit comments