Skip to content

ci: deploy frontend to github pages#378

Open
Scr4tch587 wants to merge 1 commit into
kai/react-browsefrom
kai/react-pages-deploy
Open

ci: deploy frontend to github pages#378
Scr4tch587 wants to merge 1 commit into
kai/react-browsefrom
kai/react-pages-deploy

Conversation

@Scr4tch587

Copy link
Copy Markdown
Collaborator

What changed

New `.github/workflows/deploy-pages.yml`: on push to `main` touching `frontend/**` (or manual dispatch), builds the frontend with bun and deploys `frontend/dist` to GitHub Pages via `actions/deploy-pages`. The production build already uses `base: "/datastream/"` (set in the scaffold PR), so assets resolve under `https://wat-street.github.io/datastream/\`.

One-time manual setup (repo admins)

  1. Settings → Pages → Source = "GitHub Actions"
  2. Settings → Secrets and variables → Actions → Variables: add `VITE_API_BASE_URL` = the deployed API origin (the Caddy `DOMAIN`, e.g. `https://api.example.com\` — no trailing slash, no `/api/v1`). It's baked into the bundle at build time (verified: the URL appears in `dist/assets` when set). If unset, the app falls back to relative `/api`, which won't work on Pages.

Note: Pages serves over https, so the API origin must be https too (browsers block mixed content; localhost is exempt for local testing).

Why

Gets the React app publicly hosted with zero server maintenance — the API stays wherever Caddy fronts it, with CORS (PR #374) allowing the Pages origin.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

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