fix: pass commit short hash as version to UI sidebar
Add VITE_APP_VERSION build arg to UI Dockerfile, pass short SHA from CI docker build step. vite.config.ts truncates to 7 chars so both CI build and Docker build produce consistent short hashes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -53,7 +53,7 @@ jobs:
|
||||
npm run build
|
||||
env:
|
||||
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||
VITE_APP_VERSION: ${{ github.ref_name }}@${{ github.sha }}
|
||||
VITE_APP_VERSION: ${{ github.sha }}
|
||||
|
||||
- name: Build and Test
|
||||
run: mvn clean verify -DskipITs -U --batch-mode
|
||||
@@ -112,9 +112,11 @@ jobs:
|
||||
for TAG in $IMAGE_TAGS; do
|
||||
TAGS="$TAGS -t gitea.siegeln.net/cameleer/cameleer3-server-ui:$TAG"
|
||||
done
|
||||
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
|
||||
docker buildx build --platform linux/amd64 \
|
||||
-f ui/Dockerfile \
|
||||
--build-arg REGISTRY_TOKEN="$REGISTRY_TOKEN" \
|
||||
--build-arg VITE_APP_VERSION="$SHORT_SHA" \
|
||||
$TAGS \
|
||||
--cache-from type=registry,ref=gitea.siegeln.net/cameleer/cameleer3-server-ui:buildcache \
|
||||
--cache-to type=registry,ref=gitea.siegeln.net/cameleer/cameleer3-server-ui:buildcache,mode=max \
|
||||
|
||||
Reference in New Issue
Block a user