Staging & Live

One repo, two environments. Test on staging first; monexmonad.xyz only updates when you promote to main.

URLs

EnvironmentURLUpdates when
Staging https://monex-staging.pages.dev/home.html
(shown in Cloudflare after first deploy)
You push to branch staging
Live https://monexmonad.xyz/home.html You merge stagingmain

One-time setup (Cloudflare Pages — free)

Connect Cloudflare to GitHub once. No API token changes needed.

  1. Cloudflare dashboardWorkers & PagesCreatePagesConnect to Git
  2. Authorize GitHub → choose repo MonEx
  3. Settings:
    • Project name: monex-staging
    • Production branch: staging
    • Framework preset: None
    • Build command: bash scripts/prepare-staging-site.sh
    • Build output directory: staging-dist
  4. Save and Deploy

After the first build, bookmark your staging URL (usually monex-staging.pages.dev).

Daily workflow

StepWhat you do
1. DevelopCommit changes on branch staging
2. Auto deployCloudflare Pages rebuilds staging (1–2 min)
3. TestOpen staging URL → orange STAGING banner at top
4. Go liveGitHub → Pull requestsstagingmainMerge
5. Live siteGitHub Pages updates monexmonad.xyz

API (Cloudflare Worker)

Staging and live share the same API (monex-api). Game-only changes do not need an API redeploy.

Use dev login on staging. Deploy API manually: Actions → Deploy Cloudflare API.

Branches

main     → live (GitHub Pages + monexmonad.xyz)
staging  → preview (Cloudflare Pages)

After each live release, sync staging from main:

GitHub → New PR → base: staging, compare: main → Merge

Local test workflow · Cloudflare deploy