diff --git a/web/.github/workflows/deploy-github-pages.yml b/web/.github/workflows/deploy-github-pages.yml index a44afdf..4761065 100644 --- a/web/.github/workflows/deploy-github-pages.yml +++ b/web/.github/workflows/deploy-github-pages.yml @@ -1,4 +1,4 @@ -name: Deploy redirect to GitHub Pages +name: Deploy to GitHub Pages on: push: @@ -19,43 +19,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Generate redirect pages - run: | - set -euo pipefail - DEST="https://loto.miti99.com" - mkdir -p out/master - cat > out/index.html < - - - - - Lô tô — đã chuyển sang ${DEST} - - - - - - - -

Trang đã chuyển sang ${DEST}

- - - HTML - # Mirror to /master so deep links also redirect cleanly - cp out/index.html out/master/index.html + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + - run: npm ci + - run: npm run build:gh - uses: actions/configure-pages@v5 - uses: actions/upload-pages-artifact@v3 with: - path: out + path: build deploy: needs: build diff --git a/web/.github/workflows/verify-build.yml b/web/.github/workflows/verify-build.yml index 03b4a52..5980210 100644 --- a/web/.github/workflows/verify-build.yml +++ b/web/.github/workflows/verify-build.yml @@ -25,4 +25,3 @@ jobs: - run: npm ci - run: npm test - run: npm run build - - run: npm run verify:build diff --git a/web/README.md b/web/README.md index ec53be1..a6bffeb 100644 --- a/web/README.md +++ b/web/README.md @@ -31,12 +31,13 @@ path prefix and breaks the SvelteKit base path. ## Build ```bash -npm run build # default — root basePath, for Cloudflare Pages -npm run build:gh # /loto basePath, for tiennm99.github.io/loto manual export +npm run build # root basePath (local preview / generic static host) +npm run build:gh # /loto basePath, for tiennm99.github.io/loto ``` -Static export to `build/`. Deployed to Cloudflare Pages from `main` -(set up via the CF dashboard — see `docs/deployment-guide.md`). +Static export to `build/`. Deployed to GitHub Pages from `main` via +`.github/workflows/deploy-github-pages.yml` — see +`docs/deployment-guide.md`. ## Regenerating audio diff --git a/web/docs/code-standards.md b/web/docs/code-standards.md index eecbfbe..f282256 100644 --- a/web/docs/code-standards.md +++ b/web/docs/code-standards.md @@ -189,7 +189,7 @@ Set in `.env.local` (not committed). ### Build Targets - **adapter-static**: Generates static HTML + JS in `build/`. -- **basePath**: Dual-mode: `""` (Cloudflare, dev) or `/loto` (GitHub Pages via `BUILD_PROFILE=gh`). +- **basePath**: `/loto` for production GitHub Pages (`BUILD_PROFILE=gh`); `""` for local dev / generic static preview. -Last reviewed: 2026-04-27 -Last synced: 2026-04-27 (6-phase refactor) +Last reviewed: 2026-05-09 +Last synced: 2026-05-09 (deploy target switched to GitHub Pages) diff --git a/web/docs/codebase-summary.md b/web/docs/codebase-summary.md index 5136c2f..7be4e83 100644 --- a/web/docs/codebase-summary.md +++ b/web/docs/codebase-summary.md @@ -49,15 +49,13 @@ |------|---------| | `svelte.config.js` | adapter-static (HTML export), dual basePath via BUILD_PROFILE env, SvelteKit PWA plugin config. | | `vite.config.js` | Tailwind + SvelteKit + PWA plugins. codeserver HMR config (port, allowedHosts, hmr). | -| `package.json` | SvelteKit 2, Svelte 5 (runes), Tailwind 4, Vite, @vite-pwa/sveltekit. Scripts: dev, dev:codeserver, build, build:gh, lint, test, test:watch, verify:build. | -| `scripts/verify-build-inline-scripts.mjs` | Post-build CSP guard. Counts inline `