You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
uses: {% data reusables.actions.action-checkout %}
@@ -226,18 +224,15 @@ jobs:
226
224
push: true
227
225
tags: {% raw %}${{ steps.meta.outputs.tags }}{% endraw %}
228
226
labels: {% raw %}${{ steps.meta.outputs.labels }}{% endraw %}
229
-
230
-
{% ifversion artifact-attestations %}
231
-
- name: Generate artifact attestation
232
-
uses: actions/attest-build-provenance@v3
233
-
with:
234
-
subject-name: {% data reusables.package_registry.container-registry-hostname %}/{% raw %}${{ github.repository }}{% endraw %}
235
-
subject-digest: {% raw %}${{ steps.push.outputs.digest }}{% endraw %}
236
-
push-to-registry: true
237
-
{% endif -%}
238
227
```
239
228
240
229
The above workflow checks out the {% data variables.product.github %} repository, uses the `login-action` twice to log in to both registries and generates tags and labels with the `metadata-action` action.
241
230
Then the `build-push-action` action builds and pushes the Docker image to Docker Hub and the {% data variables.product.prodname_container_registry %}.
242
231
243
-
{% ifversion artifact-attestations %}{% data reusables.actions.artifact-attestations-step-explanation %}{% endif %}
232
+
{% ifversion artifact-attestations %}> [!NOTE]
233
+
> When pushing to multiple registries:
234
+
>
235
+
> * Image digests may differ between registries, making attestation verification difficult.
236
+
> * To maintain a consistent digest and allow a single attestation to verify all copies, push to one registry first and use a tool like [`crane copy`](https://github.com/google/go-containerregistry/blob/main/cmd/crane/doc/crane_copy.md) to replicate the image elsewhere.
237
+
> * If you choose to build and push to each registry separately instead, you must generate a distinct attestation for each one to ensure your artifacts remain verifiable.
0 commit comments