Publish Docker Image #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Docker Image | ||
on: | ||
# Enable the occasional manual trigger | ||
workflow_dispatch: | ||
# This workflow is designed to be invoked by others, not triggered by events. | ||
workflow_call: | ||
inputs: | ||
target-platforms: | ||
type: string | ||
default: linux/amd64,linux/arm64 | ||
description: Platforms to target when publishing the docker image | ||
dockerhub-org: | ||
type: string | ||
default: kafkesc | ||
description: Docker Hub organization under which to publish the docker image | ||
dockerhub-imagename: | ||
type: string | ||
default: kommitted | ||
description: Name of the docker image to publish | ||
release-version: | ||
required: true | ||
type: string | ||
description: Version to publish as docker image (eg. 'vX.Y.Z') | ||
secrets: | ||
dockerhub-username: | ||
required: true | ||
description: Docker Hub username to use when publishing the image | ||
dockerhub-password: | ||
required: true | ||
description: Docker Hub password to use when publishing the image (e.g. the API token) | ||
jobs: | ||
build-and-push: | ||
name: Build&Push ${{ inputs.dockerhub-org }}/${{ inputs.dockerhub-imagename }}:${{ inputs.release-version }} (${{ inputs.target-platforms }) | ||
Check failure on line 43 in .github/workflows/hub.docker.com-publish.yml GitHub Actions / Publish Docker ImageInvalid workflow file
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set-up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.dockerhub-username }} | ||
password: ${{ secrets.dockerhub-password }} | ||
- name: Build + Push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
platforms: ${{ inputs.target-platforms }} | ||
build-args: | | ||
KOMMITTED_VERSION=${{ inputs.release-version }} | ||
tags: | | ||
${{ inputs.dockerhub-org }}/${{ inputs.dockerhub-imagename }}:latest | ||
${{ inputs.dockerhub-org }}/${{ inputs.dockerhub-imagename }}:${{ inputs.release-version }} |