okhp3-vite-github-pages
OverKill Hill P³ · overkillhill.com · github.com/OKHP3
Use this focused runbook to keep the Abrahamic Reference Engine compatible with its client-only Vite build and GitHub Pages Actions deployment. Verify the repository before relying on any remembered version or workflow detail.
Scope
| In scope |
Out of scope |
vite.config.ts, .github/workflows/deploy-pages.yml, production base paths, BrowserRouter, build artifacts, Pages permissions/artifacts, environment wiring, and deployment diagnosis |
Servers, databases, backend proxies, gh-pages branches, the legacy npm run deploy, secret creation, commits, pushes, and unrelated application changes |
Project contract
Treat these current facts as constraints, then re-read the files if the task may have changed them:
vite.config.ts sets base to /abrahamic-reference-engine/ when command === 'build' and / otherwise. The dev server listens on 0.0.0.0:5000.
src/App.tsx uses BrowserRouter with basename={import.meta.env.BASE_URL.replace(/\/$/, '')}.
.github/workflows/deploy-pages.yml runs on pushes to main or manual dispatch, uses Pages permissions and concurrency, installs with npm ci, builds with npm run build, copies dist/index.html to dist/404.html, uploads dist, and deploys with the Pages actions.
- No environment variables are passed to the Vite build at this time.
Workflow
1. Plan
Read AGENTS.md, vite.config.ts, .github/workflows/deploy-pages.yml, package.json, src/App.tsx, and the relevant recent diff. Check git status --short. Classify the request as configuration, workflow, artifact, or diagnosis before editing. Do not change deployment settings merely because a validation command succeeds.
2. Validate the source of truth
Confirm the intended repository name, Pages base, router, build script, artifact path, trigger branch, environment variables, permissions, and fallback behavior from the files. If the requested result conflicts with the client-only boundary or the checked-in workflow, stop and report the conflict.
3. Execute safely
Make the smallest compatible edit. Keep the production base exactly /abrahamic-reference-engine/, local development at /, BrowserRouter with basename, npm, and Actions-based Pages deployment. Never place OAuth/API secrets in source, workflow text, or skill output; reference GitHub secrets by name only. Do not create a gh-pages branch or add a server workaround for an SPA that already handles routing via the 404.html fallback.
4. Validate
Run npm run build for build-affecting changes. Inspect the generated dist/index.html for /abrahamic-reference-engine/ asset URLs and confirm the workflow creates dist/404.html after the build. For workflow-only edits, inspect YAML structure and still run the narrowest available checks.
5. Report
Summarize changed files, verified local results, expected Actions behavior, required repository/environment configuration, and unresolved risks. Distinguish a successful local build from a verified live Pages deployment; the latter requires an actual environment smoke test.
Gotchas
- A wrong production
base causes asset 404s under the repository subpath; do not “fix” this by changing the router to BrowserRouter.
- A successful Vite build does not prove Pages permissions, secrets, CORS, or deployed behavior are healthy.
- If environment variables are ever added to the Vite build, pass them via GitHub Actions secrets and never print or hard-code their values.
- Preserve
npm ci and the checked-in lockfile. Do not switch to pnpm or npm install as a workaround.
- Do not claim
dist/404.html exists from a local build unless the copy step was actually run; it is created by the workflow.
Output contract
Return:
- deployment diagnosis or implementation summary;
- exact files and invariants preserved;
- validation commands/results and any blocked checks;
- required GitHub/Pages environment configuration without secret values;
- live-verification status and remaining risks.
About
Built by Jamie Hill · OverKill Hill P³
Published at github.com/OKHP3
Part of the OKHP3/skillz Agent Skill library.
MIT License -- free to use, fork, and adapt. A nod to the source is appreciated.
1---2name: okhp3-vite-github-pages3description: OverKill Hill P³ Vite-to-GitHub-Pages deployment runbook. Use when deploying or troubleshooting this React/Vite app, its Actions workflow, /abrahamic-reference-engine/ production base, BrowserRouter basename fallback, dist artifacts, build validation, or Pages environment variables. Also activate for subpath asset failures or SPA refresh diagnosis. Do not use for gh-pages branches, backend hosting, or unrelated UI work.4license: MIT5---67# okhp3-vite-github-pages89**OverKill Hill P³** · [overkillhill.com](https://overkillhill.com) · [github.com/OKHP3](https://github.com/OKHP3)1011Use this focused runbook to keep the Abrahamic Reference Engine compatible with its client-only Vite build and GitHub Pages Actions deployment. Verify the repository before relying on any remembered version or workflow detail.1213## Scope1415| In scope | Out of scope |16| --- | --- |17| `vite.config.ts`, `.github/workflows/deploy-pages.yml`, production base paths, `BrowserRouter`, build artifacts, Pages permissions/artifacts, environment wiring, and deployment diagnosis | Servers, databases, backend proxies, `gh-pages` branches, the legacy `npm run deploy`, secret creation, commits, pushes, and unrelated application changes |1819## Project contract2021Treat these current facts as constraints, then re-read the files if the task may have changed them:2223- `vite.config.ts` sets `base` to `/abrahamic-reference-engine/` when `command === 'build'` and `/` otherwise. The dev server listens on `0.0.0.0:5000`.24- `src/App.tsx` uses `BrowserRouter` with `basename={import.meta.env.BASE_URL.replace(/\/$/, '')}`.25- `.github/workflows/deploy-pages.yml` runs on pushes to `main` or manual dispatch, uses Pages permissions and concurrency, installs with `npm ci`, builds with `npm run build`, copies `dist/index.html` to `dist/404.html`, uploads `dist`, and deploys with the Pages actions.26- No environment variables are passed to the Vite build at this time.2728## Workflow2930### 1. Plan3132Read `AGENTS.md`, `vite.config.ts`, `.github/workflows/deploy-pages.yml`, `package.json`, `src/App.tsx`, and the relevant recent diff. Check `git status --short`. Classify the request as configuration, workflow, artifact, or diagnosis before editing. Do not change deployment settings merely because a validation command succeeds.3334### 2. Validate the source of truth3536Confirm the intended repository name, Pages base, router, build script, artifact path, trigger branch, environment variables, permissions, and fallback behavior from the files. If the requested result conflicts with the client-only boundary or the checked-in workflow, stop and report the conflict.3738### 3. Execute safely3940Make the smallest compatible edit. Keep the production base exactly `/abrahamic-reference-engine/`, local development at `/`, `BrowserRouter` with basename, npm, and Actions-based Pages deployment. Never place OAuth/API secrets in source, workflow text, or skill output; reference GitHub secrets by name only. Do not create a `gh-pages` branch or add a server workaround for an SPA that already handles routing via the 404.html fallback.4142### 4. Validate4344Run `npm run build` for build-affecting changes. Inspect the generated `dist/index.html` for `/abrahamic-reference-engine/` asset URLs and confirm the workflow creates `dist/404.html` after the build. For workflow-only edits, inspect YAML structure and still run the narrowest available checks.4546### 5. Report4748Summarize changed files, verified local results, expected Actions behavior, required repository/environment configuration, and unresolved risks. Distinguish a successful local build from a verified live Pages deployment; the latter requires an actual environment smoke test.4950## Gotchas5152- A wrong production `base` causes asset 404s under the repository subpath; do not “fix” this by changing the router to `BrowserRouter`.53- A successful Vite build does not prove Pages permissions, secrets, CORS, or deployed behavior are healthy.54- If environment variables are ever added to the Vite build, pass them via GitHub Actions secrets and never print or hard-code their values.55- Preserve `npm ci` and the checked-in lockfile. Do not switch to pnpm or `npm install` as a workaround.56- Do not claim `dist/404.html` exists from a local build unless the copy step was actually run; it is created by the workflow.5758## Output contract5960Return:61621. deployment diagnosis or implementation summary;632. exact files and invariants preserved;643. validation commands/results and any blocked checks;654. required GitHub/Pages environment configuration without secret values;665. live-verification status and remaining risks.6768## About6970Built by [Jamie Hill](https://overkillhill.com) · [OverKill Hill P³](https://overkillhill.com)71Published at [github.com/OKHP3](https://github.com/OKHP3)72Part of the [OKHP3/skillz](https://github.com/OKHP3/skillz) Agent Skill library.73MIT License -- free to use, fork, and adapt. A nod to the source is appreciated.