Deployment
7 Nov 2026
9 min read

Deploying to Cloudflare Pages: Zero-Config Global Deployment

Step-by-step guide to deploying your SpaceZero micro-app to Cloudflare Pages with custom domains, environment variables, and preview deployments.

Deploying to Cloudflare Pages

SpaceZero is designed for zero-config deployment to Cloudflare Pages.

Quick Start

1. Push to Git

bash

git init

git add .

git commit -m "Initial commit"

git remote add origin https://github.com/yourusername/my-micro-app

git push -u origin main

2. Connect to Cloudflare Pages

  1. Go to Cloudflare Pages
  2. Click "Create a project"
  3. Connect your GitHub/GitLab repository
  4. Configure build settings:
  • Build command: npm run build
  • Build output directory: dist
  • Root directory: / (or your app folder)

3. Environment Variables

In Cloudflare Pages Dashboard → Settings → Environment Variables:

Client-safe (available in browser):

code

VITE_APP_NAME=MyApp

VITE_APP_TAGLINE=My Micro-App

VITE_APP_DESCRIPTION=Description

VITE_APP_DOMAIN=myapp.space

VITE_SUPABASE_URL=https://xxx.supabase.co

VITE_SUPABASE_ANON_KEY=xxx

VITE_GUMROAD_PRODUCT_ID=xxx

VITE_PRICE_DISPLAY=

0

VITE_CONVERTKIT_FORM_ID=xxx

Server-only (secrets):

code

SUPABASE_SERVICE_ROLE_KEY=xxx

GUMROAD_WEBHOOK_SECRET=xxx

CONVERTKIT_API_KEY=xxx

CONVERTKIT_ACCOUNT_ID=xxx

RESEND_API_KEY=xxx

4. Custom Domain

  1. Pages Dashboard → Custom domains
  2. Add myapp.space
  3. Add DNS records (Cloudflare provides)
  4. SSL auto-provisioned

5. Deploy

bash

git push origin main

Cloudflare builds and deploys automatically.

Preview Deployments

Every PR gets a preview URL:

code

https://<branch>.<project>.pages.dev

Great for testing before merging.

Branch Deployments

Configure branch-specific environment variables for staging/production.

Build Optimization

SpaceZero's build includes:

  • Brotli + Gzip compression
  • Code splitting
  • Asset hashing
  • PWA service worker
  • Sitemap/RSS/llms.txt generation

Monitoring

  • Cloudflare Analytics (free)
  • Pages Functions logs
  • Real User Metrics (RUM)

Rollback

Instant rollback to any previous deployment:

  1. Pages Dashboard → Deployments
  2. Click "Rollback" on any deployment

Benefits

  • Free Tier: Generous limits (500 builds/month, unlimited requests)
  • Global CDN: 300+ edge locations
  • Zero Config: Works out of the box
  • Preview URLs: Every PR gets a live URL
  • Instant Rollback: One-click safety net