@davoodmehraban89 / LifeMate / commits / dad2cd4
Fork 0

LifeMate — Personal, Family & Learning Companion

feat(qa): prepare isolated GitHub Pages static build without Railway

davoodmehraban89 committed Oct 15, 2026 at 08:23 UTC dad2cd452e8f508fcd2d6c6a96296b5e5e2babd8
1 file changed +34
scripts/build-github-pages-qa.sh new
+34
@@ -0,0 +1,34 @@
1 +#!/usr/bin/env bash
2 +# LifeGuide QA: STATIC PWA ONLY, built for GitHub Pages with a custom-domain root.
3 +# Do not use this as proof of user login / API readiness.
4 +set -Eeuo pipefail
5 +cd "$(dirname "$0")/.."
6 +
7 +# Reuse the already-tested, pinned Flutter 3.47.6 build and local asset bundling.
8 +bash scripts/build-cloudflare-pages-qa.sh
9 +out="apps/lifemate/build/web"
10 +
11 +# _headers is a Cloudflare Pages directive; it does not protect GitHub Pages.
12 +rm -f "$out/_headers"
13 +touch "$out/.nojekyll"
14 +
15 +node --input-type=module <<'NODE'
16 +import { readFileSync, writeFileSync } from 'node:fs';
17 +const path = 'apps/lifemate/build/web/';
18 +const config = JSON.parse(readFileSync(path + 'config.json','utf8'));
19 +if (config.apiBaseUrl !== '/api' ||
20 + !Array.isArray(config.apiFallbackUrls) ||
21 + config.apiFallbackUrls.length !== 0) {
22 + throw new Error('QA app must not silently fall back to Railway or an unverified backend');
23 +}
24 +const index = readFileSync(path + 'index.html','utf8');
25 +if (!index.includes('<base href="/">') || !index.includes('LifeGuide')) {
26 + throw new Error('GitHub Pages custom-domain root assets not configured');
27 +}
28 +const version = process.env.GITHUB_SHA?.slice(0,12) || 'local';
29 +writeFileSync(path + 'site-check.txt', 'LifeGuide GitHub Pages QA STATIC_ONLY ' + version + '\n');
30 +NODE
31 +
32 +test -s "$out/main.dart.js"
33 +test -s "$out/site-check.txt"
34 +echo "GitHub Pages QA static artifact prepared. API registration remains unavailable."