Skip to main content

Deployment

Four independently deployable pieces: API (Workers), Web (Pages), Docs (Pages), and Mobile (EAS Build). All triggered from the same GitHub repo.

What deploys where

API — Cloudflare Workers

  • Workflow: .github/workflows/cd.ymldeploy-api job.

  • Order per deploy: run migrations → build → wrangler deploy.

  • Config: apps/api/wrangler.toml (bindings, compat date, vars).

  • Secrets (Cloudflare secret store, not repo secrets): PRIVY_APP_SECRET, BRIDGE_API_KEY, BRIDGE_WEBHOOK_SECRET, NEON_DB_URL, BASE_RPC_URL. Set with wrangler secret put <NAME>.

  • Bindings: HYPERDRIVE (id in wrangler.toml).

  • Manual deploy from your machine:

    pnpm --filter @gringo-pay/api exec wrangler deploy

Web — Cloudflare Pages

  • Workflow: .github/workflows/cd.ymldeploy-web job.
  • Project name: gringo-pay-web (must match Cloudflare Pages project).
  • Build output: apps/web/dist.

Docs — Cloudflare Pages

  • Workflow: .github/workflows/docs.yml.
  • Project name: gringo-pay-docs (must match a Cloudflare Pages project).
  • URL: gringo-pay-docs.pages.dev (default; add a custom domain via the Cloudflare dashboard when ready).
  • One-time setup: create the Pages project in the Cloudflare dashboard (Pages → Create → Direct Upload → name it gringo-pay-docs). No repo settings to change.

Mobile — EAS

  • Workflow: .github/workflows/cd.ymlbuild-mobile job.
  • Currently only iOS preview builds. Android is not wired up yet.
  • Requires EXPO_TOKEN (Expo access token).
  • Distribution is via internal preview channel — no app store submission automated yet.

Required GitHub secrets

SecretUsed byPurpose
CLOUDFLARE_API_TOKENCD (api + web)Deploy to Workers + Pages
CLOUDFLARE_ACCOUNT_IDCD (api + web)Cloudflare account
DATABASE_URLCD (api migrations)Neon Postgres for drizzle-kit migrate
EXPO_TOKENCD (mobile)EAS Build authentication
TEST_NEON_DB_URLCINeon branch DB used by API tests
TURBO_TOKENCI + CD (optional)Turborepo remote cache
TURBO_TEAMCI + CD (optional)Turborepo team slug

Rollback

  • API: wrangler rollback — Cloudflare keeps recent versions.
  • Web: re-deploy a previous git SHA via workflow_dispatch.
  • Docs: re-deploy a previous git SHA via workflow_dispatch on docs.yml, or roll back via the Cloudflare Pages dashboard.
  • Mobile: re-run EAS Build on a prior SHA. Users need to install the new build.

Environments

Currently one environment: production. Sandbox Bridge credentials + a dev Neon branch are used for local dev; there is no separately-deployed staging tier.