Skip to content

Commit 26e84a4

Browse files
committed
another attempt to get the action that submits to docker hub working
1 parent 95b4f91 commit 26e84a4

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ on:
55
tags:
66
- 'v[0-9]+.[0-9]+.[0-9]+'
77
- 'v[0-9]+.[0-9]+.[0-9]+-*' # Allow pre-release tags like v1.0.0-alpha, v1.0.0-beta.1
8+
workflow_dispatch:
9+
inputs:
10+
version:
11+
description: 'Version to build (without v prefix, e.g. 2.2.1)'
12+
required: true
13+
skip_release:
14+
description: 'Skip GitHub release creation (for testing docker push only)'
15+
type: boolean
16+
default: true
817

918
permissions:
1019
contents: write
@@ -13,6 +22,7 @@ jobs:
1322
release:
1423
name: Create Release
1524
runs-on: ubuntu-latest
25+
if: ${{ github.event_name == 'push' || !inputs.skip_release }}
1626

1727
steps:
1828
- name: Checkout code
@@ -155,7 +165,7 @@ jobs:
155165
name: Push Docker Image
156166
runs-on: ubuntu-latest
157167
needs: release
158-
if: ${{ !contains(github.ref, '-') }}
168+
if: ${{ always() && (github.event_name == 'workflow_dispatch' || !contains(github.ref, '-')) }}
159169

160170
steps:
161171
- name: Checkout code
@@ -164,7 +174,11 @@ jobs:
164174
- name: Extract version from tag
165175
id: version
166176
run: |
167-
VERSION=${GITHUB_REF#refs/tags/v}
177+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
178+
VERSION="${{ inputs.version }}"
179+
else
180+
VERSION=${GITHUB_REF#refs/tags/v}
181+
fi
168182
echo "version=$VERSION" >> $GITHUB_OUTPUT
169183
170184
- name: Set up Docker Buildx

0 commit comments

Comments
 (0)