Skip to content

Commit 9b2cd16

Browse files
chore(ci): decouple docker source ref from published image tag
1 parent 190b3de commit 9b2cd16

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ name: Docker Publish
33
on:
44
workflow_dispatch:
55
inputs:
6-
tag:
7-
description: "Git tag or ref to build from (e.g. v2.0.0)"
6+
source_ref:
7+
description: "Git ref to build from (e.g. main or v2.0.0)"
8+
required: true
9+
default: "main"
10+
image_tag:
11+
description: "Docker image tag to publish (e.g. v2.0.0)"
812
required: true
913
default: "v2.0.0"
1014
push_latest:
@@ -25,7 +29,7 @@ jobs:
2529
- name: Checkout selected ref
2630
uses: actions/checkout@v5
2731
with:
28-
ref: ${{ inputs.tag }}
32+
ref: ${{ inputs.source_ref }}
2933

3034
- name: Build and push image
3135
env:
@@ -34,7 +38,7 @@ jobs:
3438
set -euo pipefail
3539
3640
REPO_LC=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
37-
TAG="${{ inputs.tag }}"
41+
TAG="${{ inputs.image_tag }}"
3842
3943
echo "Publishing ghcr.io/$REPO_LC:$TAG"
4044
if [ "${{ inputs.push_latest }}" = "true" ]; then

0 commit comments

Comments
 (0)