Skip to content

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 in packages/app-worker/.svelte-kit/cloudflare/.

  • Triggers:

    • Production Deployment: A push to the main branch.
    • Preview Deployment: A push to any branch other than main.
  • 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 build from the root.
    • Deploys the packages/app-worker/.svelte-kit/cloudflare/ directory to Cloudflare Pages.
  • 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-worker Durable Object.
    • Preview: Preview deployments are configured (again, via the Cloudflare dashboard) to bind to the execution-runner-worker-preview Durable Object.

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 main branch if there are changes within the packages/do-runner/ directory.
      • GitHub Workflow: .github/workflows/do-runner-deploy.yml
      • Action: Runs npm run deploy (which executes wrangler deploy) from the packages/do-runner/ directory.
    • Preview Deployment (execution-runner-worker-preview):
      • Triggered by a push to any branch other than main if there are changes within the packages/do-runner/ directory.
      • GitHub Workflow: .github/workflows/do-runner-preview.yml
      • Action: Runs npx wrangler deploy --env preview from the packages/do-runner/ directory. This targets the [env.preview] section in packages/do-runner/wrangler.toml.
  • wrangler.toml Structure for DO: The packages/do-runner/wrangler.toml file 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").

3. Documentation Site

  • Service: Cloudflare Pages
  • Project Name: promptable-docs
  • Source Code: packages/dev-docs/
  • Framework: VitePress
  • Trigger:
    • A push to the main branch if there are changes within the packages/dev-docs/ directory.
  • GitHub Workflow: .github/workflows/docs-deploy.yml
  • Build & Deploy Process:
    1. Installs dependencies for packages/dev-docs.
    2. Builds the VitePress site: npm run docs:build (which runs vitepress build).
    3. Deploys the output directory (.vitepress/dist) to Cloudflare Pages using npx wrangler pages deploy .vitepress/dist --project-name=promptable-docs.