From c207f4c727eac5215c6d8e1b2968d2c99ba23a74 Mon Sep 17 00:00:00 2001 From: HAHWUL Date: Wed, 4 Sep 2024 00:36:32 +0900 Subject: [PATCH] chore: Update Docker workflow to include workflow_dispatch --- .github/workflows/docker-publish.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 98de4b19..7bdb544b 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -1,15 +1,16 @@ name: Docker -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - on: push: branches: [ main ] # Publish semver tags as releases. tags: [ 'v*.*.*' ] + workflow_dispatch: + inputs: + tags: + description: 'Tags for the Docker image' + required: true + default: 'latest' env: # Use docker.io for Docker Hub if empty @@ -40,7 +41,6 @@ jobs: with: cosign-release: 'v2.1.1' - # Workaround: https://github.com/docker/build-push-action/issues/461 - name: Setup Docker buildx uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf @@ -62,7 +62,8 @@ jobs: uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | + tags: ${{ github.event.inputs.tags }} + labels: | type=ref,event=branch type=semver,pattern={{version}} type=raw,value=latest,enable={{is_default_branch}} @@ -77,4 +78,4 @@ jobs: platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file