fix: align frontend image tag with baked VITE_BUILD version
Main CI-Frontend / Build & Push (push) Successful in 40s
Main CI-Frontend / Build & Push (push) Successful in 40s
PR and candidate builds now push with the app-v* tag at build time, ensuring VITE_BUILD inside the image always matches its Docker tag. Promote step reads the version from the image instead of generating a new run_number-based tag. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -48,7 +48,9 @@ jobs:
|
||||
with:
|
||||
context: ./client
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
tags: |
|
||||
${{ steps.meta.outputs.tags }}
|
||||
rmcampos/tasknote-app:${{ steps.version.outputs.tag }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=registry,ref=rmcampos/tasknote-app:buildcache
|
||||
cache-to: type=registry,ref=rmcampos/tasknote-app:buildcache,mode=max
|
||||
|
||||
@@ -31,14 +31,6 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Generate version tag
|
||||
id: version
|
||||
run: |
|
||||
DATE=$(date +'%Y.%m.%d')
|
||||
TAG="app-v${DATE}.${{ github.run_number }}"
|
||||
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
||||
echo "Generated tag: ${TAG}"
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
run: docker buildx inspect --bootstrap
|
||||
|
||||
@@ -63,11 +55,24 @@ jobs:
|
||||
fi
|
||||
echo "tag=${PR_NUMBER}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Extract version from image
|
||||
id: version
|
||||
run: |
|
||||
docker pull rmcampos/tasknote-app:${{ steps.find_pr.outputs.tag }}
|
||||
VITE_BUILD=$(docker inspect rmcampos/tasknote-app:${{ steps.find_pr.outputs.tag }} \
|
||||
--format '{{ range .Config.Env }}{{ println . }}{{ end }}' \
|
||||
| grep '^VITE_BUILD=' | cut -d= -f2)
|
||||
if [ -z "$VITE_BUILD" ]; then
|
||||
echo "Could not extract VITE_BUILD from image" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "tag=${VITE_BUILD}" >> $GITHUB_OUTPUT
|
||||
echo "Extracted version: ${VITE_BUILD}"
|
||||
|
||||
- name: Promote Docker image
|
||||
run: |
|
||||
docker buildx imagetools create \
|
||||
--tag rmcampos/tasknote-app:latest \
|
||||
--tag rmcampos/tasknote-app:${{ steps.version.outputs.tag }} \
|
||||
rmcampos/tasknote-app:${{ steps.find_pr.outputs.tag }}
|
||||
|
||||
- name: Create and push Git tag
|
||||
|
||||
@@ -109,7 +109,9 @@ jobs:
|
||||
with:
|
||||
context: ./client
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
tags: |
|
||||
${{ steps.meta.outputs.tags }}
|
||||
rmcampos/tasknote-app:${{ steps.version.outputs.tag }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=registry,ref=rmcampos/tasknote-app:buildcache
|
||||
cache-to: type=registry,ref=rmcampos/tasknote-app:buildcache,mode=max
|
||||
|
||||
Reference in New Issue
Block a user