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
- Cloudflare Workers & Static Assets: Free tier covers static asset delivery and up to 100,000 Worker requests/day.
- Cloudflare D1: Free tier provides 5 GB SQLite storage for form submissions and newsletter subscribers.
- Cloudflare Turnstile & DNS: Free bot protection, DNS hosting, and DMARC management.
- Resend (optional): Free tier for transactional form email notifications; when
RESEND_API_KEYis unset, email dispatch logs cleanly as a stub.
Deploying a Published SWS Site (Worker + D1)
- Create your D1 database and copy the returned
database_idintowrangler.jsonc:npx wrangler d1 create my-site-db - 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 - Replace the test
TURNSTILE_SITE_KEYinwrangler.jsoncwith your production Turnstile site key. - 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:
- Ensure
jcusoftware.comis an active zone in your target Cloudflare account so Wrangler can bindsolo.jcusoftware.com(sws-landing) anddocs.jcusoftware.com(sws-docs) and provision DNS + TLS automatically on deploy. - Grant your
CLOUDFLARE_API_TOKENWorkers Scripts Edit plus Zone DNS / Workers Routes permissions onjcusoftware.com. - For forks or preview deployments without a custom domain yet, remove or comment out the
routesblocks in bothwrangler.jsoncfiles and setSWS_LANDING_URL/SWS_DOCS_URLto your*.workers.devURLs.
Current build URLs: landing https://solo.jcusoftware.com, docs https://docs.jcusoftware.com.