File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 16
16
jobs :
17
17
docker :
18
18
runs-on : docker
19
+ permissions :
20
+ id-token : write # This is needed to use Cosign in keyless mode
19
21
steps :
20
22
- uses : actions/checkout@v3
21
23
62
64
- name : Set up Docker Buildx
63
65
uses : docker/setup-buildx-action@v3
64
66
67
+ - name : Install cosign
68
+ uses : sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # tag=v3.8.2
69
+
65
70
- name : Login to Docker Hub
66
71
uses : docker/login-action@v3
67
72
with :
85
90
86
91
- name : Build and push
87
92
uses : docker/build-push-action@v6
93
+ id : build-and-push
88
94
with :
89
95
push : true
90
96
platforms : linux/amd64,linux/arm64
@@ -94,6 +100,17 @@ jobs:
94
100
COMMIT_DATE=${{ steps.build-metadata.outputs.date }}
95
101
GIT_TAG=${{ github.ref_name }}
96
102
103
+ - name : Sign the images with GitHub OIDC Token
104
+ env :
105
+ DIGEST : ${{ steps.build-and-push.outputs.digest }}
106
+ TAGS : ${{ steps.meta.outputs.tags }}
107
+ run : |
108
+ images=""
109
+ for tag in ${TAGS}; do
110
+ images+="${tag}@${DIGEST} "
111
+ done
112
+ cosign sign --yes ${images}
113
+
97
114
# /!\ Don't touch this without checking with Cloud team
98
115
- name : Send CI information to Cloud team
99
116
# Do not send if nightly build (i.e. 'schedule' or 'workflow_dispatch' event)
You can’t perform that action at this time.
0 commit comments