Files
docker/create-image-manifest/action.yaml
Lucas Dupont b59fe0d067
All checks were successful
semantic-release / release (push) Successful in 29s
feat: update version
2026-03-30 14:18:35 +00:00

87 lines
2.8 KiB
YAML

name: Docker Create image manifest
description: Build and push Docker images with Buildx
author: zertus
branding:
icon: 'anchor'
color: 'blue'
inputs:
oci-registry:
description: "OCI registry where to pull and push images"
required: true
oci-registry-username:
description: |
Username used to log against the OCI registry.
See https://github.com/docker/login-action#usage.
required: true
oci-registry-password:
description: |
Password or personal access token used to log against the OCI registry.
Can be passed in using `secrets.GITHUB_TOKEN`.
See https://github.com/docker/login-action#usage.
required: true
repository:
description: |
Repository name.
Example: `my-org/my-repo`.
See [Docker get-image-metadata action](../get-image-metadata/README.md).
default: ${{ github.repository }}
required: false
image:
description: |
Additional image name.
Example: `application`.
See [Docker get-image-metadata action](../get-image-metadata/README.md).
required: false
tag:
description: "Image tag to publish"
required: false
digests:
description: |
Comma-separated list of image digests to include in the manifest list.
Example: `sha256:abc123...,sha256:def456...`.
required: true
runs:
using: "composite"
steps:
- id: get-image-name
shell: bash
run: |
IMAGE_NAME="${{ inputs.repository }}"
if [ -n "${{ inputs.image }}" ]; then
IMAGE_NAME="${IMAGE_NAME}/${{ inputs.image }}"
fi
IMAGE_NAME="${{ inputs.oci-registry }}/${IMAGE_NAME}"
echo "image-name=$IMAGE_NAME" >> "$GITHUB_OUTPUT"
if [ -n "${{ inputs.tag }}" ]; then
IMAGE_NAME="${IMAGE_NAME}:${{ inputs.tag }}"
fi
echo "fully-qualified-image-name=$IMAGE_NAME" >> "$GITHUB_OUTPUT"
- uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
registry: ${{ inputs.oci-registry }}
username: ${{ inputs.oci-registry-username }}
password: ${{ inputs.oci-registry-password }}
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
id: setup-buildx
with:
version: v0.30.1
driver-opts: |
image=moby/buildkit:v0.26.3
- id: create-image-manifest
shell: bash
run: |
BASE_IMAGE="${{ steps.get-image-name.outputs.image-name }}"
SOURCES=""
IFS=',' read -ra ADDR <<< "${{ inputs.digests }}"
for digest in "${ADDR[@]}"; do
digest=$(echo "$digest" | xargs)
SOURCES="$SOURCES ${BASE_IMAGE}@${digest}"
done
docker buildx imagetools create -t "${{ steps.get-image-name.outputs.fully-qualified-image-name }}" $SOURCES