LifeMate — Personal, Family & Learning Companion

infra/lifeguide-github-pages-qa
chore/phase1-repository-cleanup deploy/stable-web-apk deployment-static design/mobile-accessibility-v2 design/mobile-navigation-review docs/child-education-access-decision docs/offline-data-rescue-options docs/owner-guide-and-delivery-plan docs/phase1-policy-options docs/public-review-live-2026-10-15 feat/aparat-learning-library feat/child-device-safety feat/child-identity-schema feat/flutter-mobile-navigation feat/learning-content-operations feat/local-signing-preflight feat/online-family-stage0 feat/personal-encrypted-recovery feat/private-planner-series-api feat/public-review-page feat/standalone-weekly-planner feat/weekly-planner-android final-feature-1/iran-family-school fix/auth-abuse-expiry-safety fix/auth-expiry-after-lock fix/backend-request-safety fix/lifeguide-bootstrap-naming-ci fix/lifeguide-pages-qa-base-preflight fix/lifeguide-qa-pages-env-deployment fix/local-task-persistence fix/managed-child-session-boundary fix/personal-jalali-dates fix/personal-notification-controls fix/personal-upgrade-delivery-guard fix/sms-approval-gates fix/study-duration-display infra/cloudflare-neon-migration infra/lifeguide-cloudflare-qa infra/lifeguide-github-pages-qa infra/lifeguide-supabase-qa main phase-1/foundation-completion phase-2/product-foundation-identity phase-3/planner-school-family-core phase-4/ai-learning-wellbeing phase-5/hardening-observability-release test/android-reminder-acceptance test/personal-notification-settings test/personal-recovery-acceptance test/role-entry-apk
sh 49 lines 1.92 KB
Raw
1 #!/usr/bin/env bash
2 # LifeGuide v0.7.1 QA PWA -> Cloudflare Pages. This DOES NOT deploy the backend.
3 set -Eeuo pipefail
4 cd "$(dirname "$0")/.."
5 export CI=true
6 FLUTTER_VERSION="3.47.6"
7 FLUTTER_ROOT="${HOME}/.lifeguide-qa-flutter"
8 if [[ ! -x "${FLUTTER_ROOT}/bin/flutter" ]]; then
9 git clone --quiet --depth 1 --branch "${FLUTTER_VERSION}" https://github.com/flutter/flutter.git "${FLUTTER_ROOT}"
10 fi
11 export PATH="${FLUTTER_ROOT}/bin:${PATH}"
12 flutter config --no-analytics >/dev/null
13 flutter precache --web
14 cd apps/lifemate
15 flutter pub get
16 node tool/test_web_bootstrap.mjs
17 node --test tool/test_offline_worker.mjs
18 # Root is the existing Cloudflare behaviour. GitHub Pages QA may require
19 # a repository subpath before the custom .ir hostname is configured.
20 LIFEGUIDE_FLUTTER_BASE_HREF="${LIFEGUIDE_FLUTTER_BASE_HREF:-/}"
21 case "$LIFEGUIDE_FLUTTER_BASE_HREF" in
22 /|/LifeMate/) ;;
23 *) echo "Unsupported LifeGuide QA base href" >&2; exit 2 ;;
24 esac
25 flutter build web --release --no-web-resources-cdn --pwa-strategy=none --base-href "$LIFEGUIDE_FLUTTER_BASE_HREF"
26 node tool/self_host_web.mjs build/web
27 node tool/test_web_bootstrap.mjs
28 test -s build/web/index.html
29 test -s build/web/main.dart.js
30 test -s build/web/config.json
31 # The existing PWA expects a same-origin /api; until a verified QA API exists
32 # the Pages Function responds 503 JSON, never an HTML fallback or Railway.
33 node -e "const x=require('./build/web/config.json');if(x.apiBaseUrl!=='/api'||x.apiFallbackUrls.length)process.exit(1)"
34 cat > build/web/_headers <<'HEADERS'
35 /*
36 X-Content-Type-Options: nosniff
37 Referrer-Policy: strict-origin-when-cross-origin
38 X-Frame-Options: DENY
39 Permissions-Policy: camera=(), microphone=(), geolocation=()
40 /config.json
41 Cache-Control: no-store
42 /main.dart.js
43 Cache-Control: no-cache
44 /flutter_bootstrap.js
45 Cache-Control: no-cache
46 /manifest.json
47 Cache-Control: no-cache
48 HEADERS
49 printf 'LifeGuide QA PWA static build complete. API remains disabled until verified.\n'