Update docker-publish.yml

Require setting tag
This commit is contained in:
David Heinemeier Hansson
2023-08-22 15:44:07 -07:00
committed by GitHub
parent 7c6d302baa
commit 3f6ca1648e

View File

@@ -2,6 +2,10 @@ name: Docker
on: on:
workflow_dispatch: workflow_dispatch:
inputs:
tagInput:
description: 'Tag'
required: true
release: release:
types: [created] types: [created]
@@ -31,6 +35,14 @@ jobs:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} 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 name: Build and push
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3
@@ -40,4 +52,4 @@ jobs:
push: true push: true
tags: | tags: |
ghcr.io/basecamp/kamal:latest ghcr.io/basecamp/kamal:latest
ghcr.io/basecamp/kamal:${{ github.ref_name }} ghcr.io/basecamp/kamal:${{ steps.version-tag.outputs.value }}