Skip to content

Commit f0af173

Browse files
chore: align docker-publish workflow with upstream main
Co-authored-by: Cursor <[email protected]>
1 parent b20c02a commit f0af173

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,20 @@ jobs:
6666
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
6767
type=sha,format=short
6868
69+
- name: Resolve application version
70+
id: app_version
71+
shell: bash
72+
run: |
73+
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
74+
app_version="${GITHUB_REF_NAME#v}"
75+
git_tag="${GITHUB_REF_NAME}"
76+
else
77+
app_version="0.0.0-${GITHUB_SHA::7}"
78+
git_tag=""
79+
fi
80+
echo "app_version=${app_version}" >> "$GITHUB_OUTPUT"
81+
echo "git_tag=${git_tag}" >> "$GITHUB_OUTPUT"
82+
6983
- name: Build and push backend
7084
uses: docker/build-push-action@v6
7185
with:
@@ -75,6 +89,8 @@ jobs:
7589
push: true
7690
build-args: |
7791
BUILD_REGION=global
92+
APP_VERSION=${{ steps.app_version.outputs.app_version }}
93+
GIT_TAG=${{ steps.app_version.outputs.git_tag }}
7894
tags: ${{ steps.meta.outputs.tags }}
7995
labels: ${{ steps.meta.outputs.labels }}
8096
cache-from: type=gha,scope=backend

0 commit comments

Comments
 (0)