Cloudflare Deployment Workflows (CI/CD)
Our application components are deployed to Cloudflare primarily through GitHub Actions, triggered by pushes to our repository. This ensures a consistent and automated deployment process.
1. SvelteKit Application (Frontend & App Worker)
Service: Cloudflare Pages
Build Output: Generated by
npm run build(from project root), typically located inpackages/app-worker/.svelte-kit/cloudflare/.Triggers:
- Production Deployment: A push to the
mainbranch. - Preview Deployment: A push to any branch other than
main.
- Production Deployment: A push to the
GitHub Workflow: This is powered by the Cloudflare Pages / Github integration and isn't a workflow written to our codebase.
- The workflow checks out the code, installs dependencies, runs
npm run buildfrom the root. - Deploys the
packages/app-worker/.svelte-kit/cloudflare/directory to Cloudflare Pages.
- The workflow checks out the code, installs dependencies, runs
Durable Object Bindings:
- Production: The production deployment of the SvelteKit app on Cloudflare Pages is configured (via the Cloudflare dashboard) to bind to the
execution-runner-workerDurable Object. - Preview: Preview deployments are configured (again, via the Cloudflare dashboard) to bind to the
execution-runner-worker-previewDurable Object.
- Production: The production deployment of the SvelteKit app on Cloudflare Pages is configured (via the Cloudflare dashboard) to bind to the
2. Durable Object (DO) Worker (execution-runner-worker)
Service: Cloudflare Workers
Source Code:
packages/do-runner/Configuration:
packages/do-runner/wrangler.toml(This single file defines both production and preview environments for the DO).Triggers:
- Production Deployment (
execution-runner-worker):- Triggered by a push to the
mainbranch if there are changes within thepackages/do-runner/directory. - GitHub Workflow:
.github/workflows/do-runner-deploy.yml - Action: Runs
npm run deploy(which executeswrangler deploy) from thepackages/do-runner/directory.
- Triggered by a push to the
- Preview Deployment (
execution-runner-worker-preview):- Triggered by a push to any branch other than
mainif there are changes within thepackages/do-runner/directory. - GitHub Workflow:
.github/workflows/do-runner-preview.yml - Action: Runs
npx wrangler deploy --env previewfrom thepackages/do-runner/directory. This targets the[env.preview]section inpackages/do-runner/wrangler.toml.
- Triggered by a push to any branch other than
- Production Deployment (
wrangler.tomlStructure for DO: Thepackages/do-runner/wrangler.tomlfile contains:- Default settings for the production worker (
name = "execution-runner-worker"). - An
[env.preview]section that overrides settings for the preview worker (e.g.,name = "execution-runner-worker-preview").
- Default settings for the production worker (
3. Documentation Site
- Service: Cloudflare Pages
- Project Name:
promptable-docs - Source Code:
packages/dev-docs/ - Framework: VitePress
- Trigger:
- A push to the
mainbranch if there are changes within thepackages/dev-docs/directory.
- A push to the
- GitHub Workflow:
.github/workflows/docs-deploy.yml - Build & Deploy Process:
- Installs dependencies for
packages/dev-docs. - Builds the VitePress site:
npm run docs:build(which runsvitepress build). - Deploys the output directory (
.vitepress/dist) to Cloudflare Pages usingnpx wrangler pages deploy .vitepress/dist --project-name=promptable-docs.
- Installs dependencies for