Skip to content

CI/CD Pipeline

tripplan.ing uses GitHub Actions for continuous integration and deployment. A single workflow handles validation, building, and deployment of the unified Worker.

Workflows

WorkflowFileTriggerPurpose
App CI/CD.github/workflows/apps-ci.ymlPush to mainBuild and deploy the unified Worker
Docs Deploy.github/workflows/docs-deploy.ymlPush to main (docs changes)Build and deploy the docs site

App CI/CD pipeline

The apps-ci.yml workflow runs these stages in order:

1. Validate

npm ci          → Install all workspace dependencies
npm run check   → TypeScript + Svelte type checking + boundary checks
npm test        → Unit and integration tests

If any check fails, the pipeline stops. No deployment occurs.

2. Build

npm run build   → Build the Worker with adapter-cloudflare

This produces the Worker bundle ready for Wrangler deployment.

3. Migrate

wrangler d1 migrations apply DB --remote

Applies any pending D1 migrations. Migrations run before deployment to ensure the database schema matches the new code.

4. Sync secrets

Pushes required secrets to the Worker:

wrangler secret put STRIPE_SECRET_KEY
wrangler secret put STRIPE_WEBHOOK_SECRET
wrangler secret put MAILGUN_API_KEY
wrangler secret put MAILGUN_DOMAIN

Values come from the GitHub Environment secrets.

5. Deploy

wrangler deploy

Deploys the Worker to Cloudflare. The Worker name and environment are determined by GitHub Environment variables.

Environment matrix

The workflow uses GitHub Environments to manage per-environment configuration:

EnvironmentWorker nameDomain suffixTrigger
developmenttripplan-devdev.tripplan.ingPush to main
productiontripplantripplan.ingPush to main

Both environments are deployed on push to main. You can configure branch protection rules or manual approval in GitHub Environment settings to gate production deployments.

Docs pipeline

The docs-deploy.yml workflow:

  1. Builds the VitePress site: npm run docs:build
  2. Deploys the static site to a separate Cloudflare Worker

Docs use their own worker name (e.g., tripplan-docs / tripplan-docs-dev).

Rollback

To roll back a bad deployment:

  1. Find the last known-good commit SHA
  2. Manually trigger apps-ci.yml targeting that SHA, or revert and push
  3. The pipeline re-runs: validate → build → migrate → sync → deploy

WARNING

Database migrations are forward-only. If a migration added a column, rolling back the code won't remove the column. Ensure new code handles extra columns gracefully, or write a reverse migration.

Manual deployment

For emergency deploys outside CI:

bash
# Build locally
npm run build

# Deploy with wrangler
cd apps/event-site
npx wrangler deploy

Ensure your local wrangler.toml has the correct resource IDs and your Cloudflare token has deploy permissions.

Retired workflows

These legacy workflows have been removed:

  • control-plane-deploy.yml — separate control plane app
  • event-deploy-from-manifest.yml — per-event deployments

All deployment now goes through the single apps-ci.yml workflow.

Released under the MIT License.