Skip to content

ci(lighthouse): rewire LHCI gate for SSR Astro app + client-side i18n - #20

Closed
acamarata wants to merge 2 commits into
mainfrom
ci/lighthouse-ssr-gate
Closed

acamarata wants to merge 2 commits into
mainfrom
ci/lighthouse-ssr-gate

Conversation

@acamarata

Copy link
Copy Markdown
Contributor

Summary

  • Rewire the Lighthouse CI gate to work with the SSR Astro app (was misconfigured for the Next→Astro migration: staticDistDir: './dist' against an output: 'server' app with no dist).
  • The four audited landing pages (/, /dawah, /donate, /legal/sharia-disclaimer) are now prerender = true, so pnpm build emits their static HTML into .vercel/output/static, which LHCI serves via staticDistDir. Deterministic, no running server needed. This is also a production win (CDN-cached HTML vs SSR per request).
  • Fixed the two real SEO/a11y defects the gate surfaced: legible font size (0.72→0.75rem) and descriptive link text on the shared DisclaimerBanner.
  • Removed continue-on-error: true from the Run Lighthouse CI step — the perf/a11y/SEO score gate (minScore 0.95) is blocking again.
  • Bundles the client-side locale-swap / RTL i18n work that was in-flight in the same tree (makes ar/ur render RTL; e2e suite un-gated in ci.yml).

Local verification (exact CI toolchain: @lhci/cli@0.13.x)

URL perf a11y best-practices seo
/ 1.0 0.95 0.96 1.0
/dawah/ 1.0 0.95 0.96 1.0
/donate/ 1.0 1.0 0.96 1.0
/legal/sharia-disclaimer/ 1.0 1.0 0.96 1.0

Build, typecheck, lint, unit tests, and Playwright e2e (chromium, 17 passed / 1 skipped) all green locally.

Apply the NEXT_LOCALE cookie on the client (lang/dir + translated hero
copy) on prerendered pages, and add src/lib/i18n.ts message catalogs plus
middleware. This makes ar/ur render RTL correctly, so the Playwright e2e
suite is reliable again — drop continue-on-error from the E2E Tests job.
…ocking

The app is SSR (output: 'server', @astrojs/vercel) so there is no ./dist
for LHCI's staticDistDir. Mark the four audited landing pages
prerender=true so `pnpm build` emits their static HTML into
.vercel/output/static, which LHCI serves directly — deterministic, no
running server needed. Fix the two SEO/a11y defects the gate surfaced
(legible font size, descriptive link text), then drop continue-on-error
so the perf/a11y/SEO score gate (minScore 0.95) is blocking again.

- web/lighthouserc.cjs: staticDistDir -> .vercel/output/static, runs 1->3
- web/src/components/DisclaimerBanner.astro: font 0.72->0.75rem; link text
  "Learn more" -> "Read our Sharia content guidelines"
- web/src/pages/{dawah,donate,legal/sharia-disclaimer}: prerender=true
  (index.astro prerender landed in the preceding i18n commit)
- .github/workflows/_reusable-lighthouse.yml: remove continue-on-error
- web/.gitignore: ignore .lighthouseci/
@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ummat-chatislam Ready Ready Preview, Comment Jun 25, 2026 3:41pm

Request Review

@github-actions

Copy link
Copy Markdown

🟢 Rampart Security Gate — CLEAN

Tool CRITICAL HIGH MEDIUM LOW
(no findings)

Totals: 0 critical · 0 high · 0 medium · 0 low

Mode: RAMPART_ENFORCE=warn

@acamarata acamarata closed this Jun 25, 2026
@acamarata
acamarata deleted the ci/lighthouse-ssr-gate branch June 25, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant