From 3f6ca1648e3f1033e35128f4ebef723abb6d5861 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 22 Aug 2023 15:44:07 -0700 Subject: [PATCH] Update docker-publish.yml Require setting tag --- .github/workflows/docker-publish.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 5670b6738..b568f68a8 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -2,6 +2,10 @@ name: Docker on: workflow_dispatch: + inputs: + tagInput: + description: 'Tag' + required: true release: types: [created] @@ -31,6 +35,14 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Determine version tag + id: version-tag + run: | + INPUT_VALUE="${{ github.event.inputs.tagInput }}" + if [ -z "$INPUT_VALUE" ]; then + INPUT_VALUE="${{ github.ref_name }}" + fi + echo "::set-output name=value::$INPUT_VALUE" - name: Build and push uses: docker/build-push-action@v3 @@ -40,4 +52,4 @@ jobs: push: true tags: | ghcr.io/basecamp/kamal:latest - ghcr.io/basecamp/kamal:${{ github.ref_name }} + ghcr.io/basecamp/kamal:${{ steps.version-tag.outputs.value }}