Publish a signed multi-arch container image from pre-built per-architecture images.
Build and test each architecture in your workflow, then use this action to publish the final image.
- multi-arch tags such as
v1.2.3andlatest - optional per-platform tags such as
v1.2.3-amd64 - sign and verify the per-platform images and final multi-arch manifest
- verify provenance on the per-platform images before publishing final tags
To quickly get up and running:
- Copy the workflow that matches your registry to your default branch:
- Example Publish for GHCR or
- Example Publish Docker Hub for Docker Hub.
- On GitHub, in your repo's Actions tab, run the copied workflow.
This will publish a demo image package at ghcr.io/<owner>/<repo-name>-demo.
Notes:
- The published package also includes signatures and provenance for the per-platform images.
- GHCR is recommended for larger or frequently re-run publish jobs because Docker Hub free accounts have pull-rate limits.
To now build your projects images, change this in the copied workflow:
- Step
Build image: SetfiletoDockerfile(in your repo root) - Optional: Update step
Test imagewith real tests for your image - Update the env variable
IMAGE_REFto your real image name, for exampleghcr.io/<owner>/<repo-name>
- name: Publish MultiArch Image
id: publish
uses: gh-workflow/multiarch-image-publish@0.2.5
with:
image_ref: ghcr.io/acme/my-image
tags: |
${{ github.ref_name }}
latest
platform_digests: |
linux/amd64=sha256:...
linux/arm64=sha256:...
publish_platform_tags: "true"
annotations: |
org.opencontainers.image.source=https://github.com/acme/my-image
org.opencontainers.image.version=${{ github.ref_name }}platform_digests are the pushed per-architecture image digests produced earlier in your workflow.
For each requested tag, the action publishes:
- the multi-arch tag, for example
v1.2.3
If publish_platform_tags is set to true, the action also publishes:
- a tag on each arch image, for example
v1.2.3-amd64orv1.2.3-arm64
The action does not build images for you. It takes already-built per-platform digests, signs and verifies those images, then publishes the final multi-arch manifest and tags.
| Name | Required | Description |
|---|---|---|
image_ref |
yes | Image reference, for example ghcr.io/acme/my-image. |
tags |
yes | Newline-separated tags to publish. |
platform_digests |
yes | Newline-separated platform=digest entries. |
publish_platform_tags |
no | Publish per-platform tags like tag-amd64. Default: false. |
annotations |
no | Newline-separated key=value manifest annotations. |
certificate_oidc_issuer |
no | Expected issuer for cosign verification. |
| Name | Description |
|---|---|
manifest_digest |
Published multi-arch manifest digest. |
- registry login already performed in the publishing job
id-token: writefor keylesscosignsigningpackages: writefor GHCR registriesDOCKERHUB_USERNAMEandDOCKERHUB_TOKENsecrets for Docker Hub examples