Files
2026-05-04 16:00:14 +08:00

59 lines
2.0 KiB
YAML

name: Push linux docker multi-arch image to registry
inputs:
docker-image-name:
required: true
description: "The repository name of the docker image to build."
docker-username:
required: true
description: "Username for logging in to the docker registry."
docker-password:
required: true
description: "Password for logging in to the docker registry."
docker-bake-meta-file-path:
required: true
description: "The file path to the docker bake meta file."
docker-bake-meta-artifact-name:
required: true
description: "The name of the artifact that contains the docker bake meta file."
docker-bake-digests-file-path:
required: true
description: "The file path to save the docker bake digests file. The file will be created with the name of the digest under this path."
docker-bake-digests-artifact-name-prefix:
required: true
description: "The prefix for the docker bake digests artifact name."
docker-image-tags:
required: true
description: "The tags for the docker image to push."
runs:
using: "composite"
steps:
- name: Download docker bake meta artifact
uses: actions/download-artifact@v8
with:
name: ${{ inputs.docker-bake-meta-artifact-name }}
path: ${{ runner.temp }}
- name: Download digests artifact
uses: actions/download-artifact@v8
with:
pattern: ${{ inputs.docker-bake-digests-artifact-name-prefix }}-*
merge-multiple: true
path: ${{ inputs.docker-bake-digests-file-path }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to DockerHub
uses: docker/login-action@v4
with:
username: ${{ inputs.docker-username }}
password: ${{ inputs.docker-password }}
- name: Create manifest and push
shell: bash
working-directory: ${{ inputs.docker-bake-digests-file-path }}
run: |
docker buildx imagetools create $(echo "${{ inputs.docker-image-tags }}" | xargs -I {} echo -n " -t {}") $(printf '${{ inputs.docker-image-name }}@sha256:%s ' *)