Deployment

SWS targets Cloudflare's free tier for both published dynamic-form sites and pure static Workers such as the landing and documentation sites.

Cloudflare Free-Tier Footprint

Deploying a Published SWS Site (Worker + D1)

  1. Create your D1 database and copy the returned database_id into wrangler.jsonc:
    npx wrangler d1 create my-site-db
  2. Configure production secrets (never commit secrets or .dev.vars):
    npx wrangler secret put TURNSTILE_SECRET_KEY
    # Optional email forwarding:
    npx wrangler secret put RESEND_API_KEY
  3. Replace the test TURNSTILE_SITE_KEY in wrangler.jsonc with your production Turnstile site key.
  4. Apply remote D1 migrations and deploy:
    npx wrangler d1 migrations apply DB --remote
    npx wrangler deploy

Deploying the Landing & Docs Static Sites

This repository ships two zero-Worker-code Cloudflare Static Assets sites:

Site Worker Name Wrangler Config Custom Domain
Landing & Downloads sws-landing sites/landing/wrangler.jsonc solo.jcusoftware.com
Documentation sws-docs sites/docs/wrangler.jsonc docs.jcusoftware.com

Tag-Only Automated Releases

Merges to main run CI verification only and never publish releases or deploy to Cloudflare. Releases run exclusively when you push an annotated Git tag:

git tag -a v0.1.0 -m "Release v0.1.0"
git push origin v0.1.0

On every v* tag, .github/workflows/release.yml verifies Rust tests, cargo deny, Wasm clippy, static sites, and header parity, builds CLI binaries (when crates/sws-cli is present), creates the GitHub Release, and — when CLOUDFLARE_API_TOKEN is configured — builds and deploys both sws-landing and sws-docs with links pointing directly to the tagged release.

GitHub Repository Secrets & Variables

Name Kind Default / Purpose
CLOUDFLARE_API_TOKEN Secret Enables Cloudflare deploys on v* tags (skipped safely if unset)
CLOUDFLARE_ACCOUNT_ID Secret Target Cloudflare account ID for Wrangler deploys
SWS_LANDING_URL Variable (optional) Defaults to https://solo.jcusoftware.com; override for forks or *.workers.dev preview deployments
SWS_DOCS_URL Variable (optional) Defaults to https://docs.jcusoftware.com; override for forks or *.workers.dev preview deployments
SWS_SHOWCASE_URL Variable (optional) When set, adds direct "Open Live Showcase" links across both sites

Custom Domains & Cloudflare DNS

Both sites/landing/wrangler.jsonc and sites/docs/wrangler.jsonc declare Cloudflare Custom Domain routes (solo.jcusoftware.com and docs.jcusoftware.com) alongside workers_dev: true:

  1. Ensure jcusoftware.com is an active zone in your target Cloudflare account so Wrangler can bind solo.jcusoftware.com (sws-landing) and docs.jcusoftware.com (sws-docs) and provision DNS + TLS automatically on deploy.
  2. Grant your CLOUDFLARE_API_TOKEN Workers Scripts Edit plus Zone DNS / Workers Routes permissions on jcusoftware.com.
  3. For forks or preview deployments without a custom domain yet, remove or comment out the routes blocks in both wrangler.jsonc files and set SWS_LANDING_URL / SWS_DOCS_URL to your *.workers.dev URLs.

Current build URLs: landing https://solo.jcusoftware.com, docs https://docs.jcusoftware.com.