mirror of
https://github.com/tiennm99/ai-labs.git
synced 2026-09-04 01:09:01 +00:00
Replace bun.lock with package-lock.json and add package.json#allowScripts for esbuild and sharp, the two native packages whose install scripts npm 11 gates. Update README, RUNBOOK, TODOS and CLAUDE.md to npm commands. CLAUDE.md also claimed ./setup requires bun; it does not any more. Verified: astro check 0 errors, 39 tests pass, 4 pages build, clean npm ci.
2.6 KiB
2.6 KiB
Runbook — Hình Học Sống
Deployment
Production deploys from main via GitHub Actions (.github/workflows/deploy.yml).
- Live URL:
https://tiennm99.github.io/try-gstack/ - Build:
npm run build(Astro static, output todist/) - Deploy mechanism:
actions/upload-pages-artifact@v3+actions/deploy-pages@v4 - Concurrency:
pages-deploygroup, cancel-in-progress disabled (so a force-pushed retry doesn't abort an in-flight rollback)
Rollback
GitHub Pages keeps the last successful deployment. To roll back:
- Find the offending commit on
main:git log --oneline main - Revert it:
git revert <sha>and push tomain - The next workflow run rebuilds and re-deploys the prior good state
- Verify the live site
If the workflow itself is broken (e.g., bad deploy.yml change), use the GitHub UI to re-run a previous successful deployment from the Deployments tab.
CI
.github/workflows/ci.ymlruns typecheck + Vitest + build on every PR and push tomain. Build failure onmainblocks the deploy job.- Local equivalent:
npm install && npm run typecheck && npm test && npm run build
Domain migration trigger
Per autoplan plan, buy a .vn / .com.vn domain only when ANY of:
- 500 unique sessions in any rolling 30-day window post-launch, OR
- 1 organic teacher share (Facebook group, Zalo, or school chat — verified, not founder-initiated), OR
- ≥5 modules shipped (signals content sustainability and amortizes the domain cost)
If none hit within 90 days of soft launch, stay on tiennm99.github.io/try-gstack/.
When the trigger fires:
- Register the domain (VN registration: passport scan + address proof + MIC filing, 7–14 days)
- Add
CNAMEfile at repo root with the new domain (e.g.hinhhocsong.vn) - Configure custom domain in GitHub Pages settings (Settings → Pages → Custom domain)
- Update
astro.config.mjs: changeSITE_BASEenv from/try-gstackto/, pointSITE_URLat the new domain. Or update the workflowenv:block. - Update OpenGraph + canonical URLs (handled automatically once
astro.config.mjsreflects the new domain) - Wait 24h, then update sitemap submission in Google Search Console
- Set up 301 redirects (GitHub Pages handles this automatically once the custom domain is the primary)
Things to NOT do
- Never
git push --forcetomain. - Never edit
VERSIONorpackage.json.versionindependently — they must agree (/shipenforces this). - Never change
astro.config.mjsbasewithout simultaneously updating the deploy workflowenv:and any hardcoded internal links.