@@ -93,25 +93,34 @@ jobs:
93
93
restore-keys : ${{ runner.os }}-buildx-
94
94
95
95
# -------------------------------------------------------------
96
- # 3️⃣ Build & tag image (timestamp + latest)
96
+ # Build & push image (timestamp + latest)
97
97
# -------------------------------------------------------------
98
+
99
+ - name : 🔑 Log in to GHCR
100
+ uses : docker/login-action@v3
101
+ with :
102
+ registry : ghcr.io
103
+ username : ${{ github.actor }}
104
+ password : ${{ secrets.GITHUB_TOKEN }}
105
+
98
106
- name : 🏗️ Build Docker image
99
107
env :
100
108
DOCKER_CONTENT_TRUST : " 1"
101
109
run : |
102
110
TAG=$(date +%s)
103
111
echo "TAG=$TAG" >> "$GITHUB_ENV"
104
112
docker buildx build \
113
+ --platform linux/amd64,linux/arm64 \
105
114
--file Containerfile.lite \
106
115
--tag $IMAGE_NAME:$TAG \
107
116
--tag $IMAGE_NAME:latest \
108
117
--cache-from type=local,src=${{ env.CACHE_DIR }} \
109
118
--cache-to type=local,dest=${{ env.CACHE_DIR }},mode=max \
110
- --load \
119
+ --push \
111
120
. # build context is mandatory
112
121
113
122
# -------------------------------------------------------------
114
- # 4️⃣ Image lint (Dockle CLI → SARIF)
123
+ # Image lint (Dockle CLI → SARIF)
115
124
# -------------------------------------------------------------
116
125
- name : 🔍 Image lint (Dockle)
117
126
id : dockle
@@ -133,7 +142,7 @@ jobs:
133
142
sarif_file : dockle-results.sarif
134
143
135
144
# -------------------------------------------------------------
136
- # 5️⃣ Generate SPDX SBOM with Syft
145
+ # Generate SPDX SBOM with Syft
137
146
# -------------------------------------------------------------
138
147
- name : 📄 Generate SBOM (Syft)
139
148
uses : anchore/sbom-action@v0
@@ -142,7 +151,7 @@ jobs:
142
151
output-file : sbom.spdx.json
143
152
144
153
# -------------------------------------------------------------
145
- # 6️⃣ Trivy, Grype CVE scan → SARIF
154
+ # Trivy, Grype CVE scan → SARIF
146
155
# -------------------------------------------------------------
147
156
- name : 🛡️ Trivy vulnerability scan
148
157
id : trivy
@@ -176,23 +185,7 @@ jobs:
176
185
sarif_file : grype-results.sarif
177
186
178
187
# -------------------------------------------------------------
179
- # 7️⃣ Push both tags to GHCR
180
- # -------------------------------------------------------------
181
- - name : 🔑 Log in to GHCR
182
- uses : docker/login-action@v3
183
- with :
184
- registry : ghcr.io
185
- username : ${{ github.actor }}
186
- password : ${{ secrets.GITHUB_TOKEN }}
187
-
188
- - name : 🚀 Push image to GHCR
189
- if : github.ref == 'refs/heads/main'
190
- run : |
191
- docker push $IMAGE_NAME:${{ env.TAG }}
192
- docker push $IMAGE_NAME:latest
193
-
194
- # -------------------------------------------------------------
195
- # 8️⃣ Key-less Cosign sign + attest (latest **and** timestamp)
188
+ # Key-less Cosign sign + attest (latest **and** timestamp)
196
189
# -------------------------------------------------------------
197
190
- name : 📥 Install Cosign
198
191
if : github.ref == 'refs/heads/main'
@@ -215,7 +208,7 @@ jobs:
215
208
done
216
209
217
210
# -------------------------------------------------------------
218
- # 9️⃣ Single gate - fail job on any scanner error
211
+ # Single gate - fail job on any scanner error
219
212
# -------------------------------------------------------------
220
213
- name : ⛔ Enforce lint & vuln gates
221
214
if : |
0 commit comments