Verify deployed build metadata
CI - Build & Verify / Build, Typecheck & Hygiene (push) Successful in 1m1s
CI - Build & Verify / Deploy to award.noveria.net (push) Successful in 3m39s

This commit is contained in:
AzuTear
2026-06-29 18:23:33 +02:00
parent 65c9815baa
commit 049db2e0e0
+7 -2
View File
@@ -171,9 +171,12 @@ jobs:
alpine:latest \
sh -lc '
test -d /app/frontend
mkdir -p /app/frontend/public
printf "VITE_BUILD_VERSION=%s\nVITE_BUILD_DATE=%s\n" "$BUILD_VERSION" "$BUILD_DATE" > /app/frontend/.env.production
printf "{\n \"version\": \"%s\",\n \"buildDate\": \"%s\"\n}\n" "$BUILD_VERSION" "$BUILD_DATE" > /app/frontend/public/build-meta.json
echo "Frontend build metadata:"
cat /app/frontend/.env.production
cat /app/frontend/public/build-meta.json
'
- name: Prepare deploy host disk headroom
@@ -308,9 +311,11 @@ jobs:
css_asset="$(printf "%s" "$index" | grep -Eo '/assets/index-[^"]+\.css' | head -n 1)"
test -n "$js_asset"
test -n "$css_asset"
js_body="$(curl -fsS --max-time 20 "${LIVE_URL}${js_asset}")"
printf "%s" "$js_body" | grep -Fq "${{ steps.meta.outputs.build_version }}"
curl -fsS --max-time 20 "${LIVE_URL}${js_asset}" >/dev/null
curl -fsS --max-time 20 "${LIVE_URL}${css_asset}" >/dev/null
meta_body="$(curl -fsS --max-time 15 "${LIVE_URL}/build-meta.json")"
echo "$meta_body"
echo "$meta_body" | grep -Fq '"version": "${{ steps.meta.outputs.build_version }}"'
echo "Frontend assets served: ${js_asset}, ${css_asset}"
echo "Frontend version verified: ${{ steps.meta.outputs.build_version }}"