feat: Cloudflare deployment pipeline — wrangler.toml + GitHub Actions#674
Merged
codercatdev merged 2 commits intodevfrom Mar 16, 2026
Merged
feat: Cloudflare deployment pipeline — wrangler.toml + GitHub Actions#674codercatdev merged 2 commits intodevfrom
codercatdev merged 2 commits intodevfrom
Conversation
Add dev/production environment configuration and CI/CD: wrangler.toml: - Dev environment (top-level): codingcatdev worker, dev Sanity dataset, codingcat-auth-dev D1 database - Production environment ([env.production]): codingcatdev-production worker, production Sanity dataset, codingcat-auth D1 database - All bindings declared in BOTH environments (CF bindings are non-inheritable) - Replaces wrangler.jsonc with proper TOML format GitHub Actions (.github/workflows/deploy.yml): - Triggers on push to dev and main branches - dev branch → build with SANITY_DATASET=dev → wrangler deploy (dev worker) - main branch → build with SANITY_DATASET=production → wrangler deploy --env production - Uses CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID from GitHub secrets astro.config.mjs: - Sanity dataset now reads from process.env.SANITY_DATASET (falls back to "production") - Sanity project ID from process.env.SANITY_PROJECT_ID (falls back to hardcoded) - Enables per-environment Sanity dataset at build time Also: - .dev.vars.example for local development secrets - D1 database IDs are placeholders — Alex needs to create databases and update Build verified: 9.9s ✅ Co-authored-by: seniordeveloper <seniordeveloper@miriad.systems>
B1: Replace npm ci with pnpm/action-setup + pnpm install --frozen-lockfile.
Build via pnpm --filter @codingcatdev/web build (respects workspace).
wrangler deploy still runs from apps/web/ working directory.
I1: Restore global_fetch_strictly_public compatibility flag that was in
the original wrangler.jsonc. Dropping it unintentionally could cause
runtime fetch behavior changes.
Build verified: 10.5s
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cloudflare Deployment Pipeline
Adds wrangler.toml with dev/production environments and GitHub Actions CI/CD.
wrangler.toml
Replaces
wrangler.jsoncwith proper TOML format following @softwarearchitect's environment separation doc.[env.production])codingcatdevcodingcatdev-productiondevproductioncodingcat-auth-devcodingcat-authcodingcatdev.workers.devcodingcat.devAll bindings declared in both environments — CF bindings are non-inheritable.
GitHub Actions
.github/workflows/deploy.yml:dev→ build withSANITY_DATASET=dev→wrangler deploy(dev worker)main→ build withSANITY_DATASET=production→wrangler deploy --env productionCLOUDFLARE_API_TOKEN+CLOUDFLARE_ACCOUNT_IDfrom GitHub secrets (already set by Alex)astro.config.mjs
Sanity integration now reads dataset from
process.env.SANITY_DATASET(with fallback to"production"). This enables per-environment Sanity dataset at build time — the GitHub Actions workflow sets the correct value based on branch.Before First Deploy
Alex needs to:
database_idvalues inwrangler.tomlwith the IDs from step 1wrangler secret put BETTER_AUTH_SECRET wrangler secret put BETTER_AUTH_URL wrangler secret put GOOGLE_CLIENT_ID wrangler secret put GOOGLE_CLIENT_SECRET wrangler secret put SANITY_API_TOKEN wrangler secret put SANITY_PREVIEW_SECRET # Repeat with --env production for production valuesBuild
9.5s ✅