Skip to content

Cloudflare hosting

StoreCay Starter runs as a Cloudflare Worker (Astro + @astrojs/cloudflare), with D1 and R2 bindings from wrangler.jsonc.

From your clone / fork:

Terminal window
npx wrangler secret put SESSION_SECRET
npx wrangler secret put GUEST_TOKEN_SECRET
# optional
npx wrangler secret put STRIPE_SECRET_KEY
npx wrangler secret put STRIPE_WEBHOOK_SECRET
npx wrangler secret put PAYPAL_CLIENT_SECRET
npx wrangler secret put RESEND_API_KEY
npx wrangler d1 migrations apply DB --remote
npm run build
npx wrangler deploy

In the Cloudflare dashboard: Workers & Pages → your Worker → Settings → Domains & Routes (or Triggers). Attach your zone hostname and finish DNS as prompted.

The template ships .github/workflows/deploy-to-cloudflare-workers.yml (push to main):

Kind Names
Secrets CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID
Vars (optional) PUBLIC_STRIPE_KEY, PUBLIC_PAYPAL_CLIENT_ID, PAYPAL_ENV, PUBLIC_INPOST_GEOWIDGET_TOKEN

Project defaults stay in committed store.config.ts. Server secrets stay in Wrangler secrets, not in the repo.

Prefer the dashboard flow: One-click deploy.