Skip to content

Commit 5041af8

Browse files
committed
fixed docker version build
1 parent d00dbcc commit 5041af8

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.github/workflows/build-docker.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on:
1111
type: boolean
1212
required: false
1313
default: true
14+
app_version:
15+
description: 'Application version'
16+
type: string
17+
required: false
18+
default: ''
1419

1520
# Cancel in-progress runs for the same PR
1621
concurrency:
@@ -34,18 +39,32 @@ jobs:
3439
timeout-minutes: 1
3540
run: |
3641
githubHeadRef=${{ env.githubHeadRef }}
42+
inputVersion="${{ inputs.app_version }}"
3743
latestDockerTag=""
3844
versionDockerTag=""
3945
majorVersionDockerTag=""
4046
minorVersionDockerTag=""
4147
version="0.0.1"
4248
43-
if [[ "$githubRef" =~ ^"refs/tags/" ]]; then
49+
if [[ -n "$inputVersion" ]]; then
50+
# Version provided via input (manual release)
51+
branch="main"
52+
latestDockerTag="latest"
53+
versionDockerTag="$inputVersion"
54+
version="$inputVersion"
55+
56+
# Extract major and minor versions for additional tags
57+
if [[ "$versionDockerTag" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
58+
majorVersionDockerTag="${BASH_REMATCH[1]}"
59+
minorVersionDockerTag="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
60+
fi
61+
elif [[ "$githubRef" =~ ^"refs/tags/" ]]; then
62+
# Tag push
4463
branch=${githubRef##*/}
4564
latestDockerTag="latest"
4665
versionDockerTag=${branch#v}
4766
version=${branch#v}
48-
67+
4968
# Extract major and minor versions for additional tags
5069
if [[ "$versionDockerTag" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
5170
majorVersionDockerTag="${BASH_REMATCH[1]}"

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ jobs:
149149
uses: ./.github/workflows/build-docker.yml
150150
with:
151151
push_docker: ${{ needs.validate.outputs.is_tag == 'true' || github.event.inputs.pushDocker == 'true' }}
152+
app_version: ${{ needs.validate.outputs.app_version }}
152153
secrets: inherit
153154

154155
# Create GitHub release

0 commit comments

Comments
 (0)