Skip to content

Deployment

Huddle deploys across two platforms, split by workload:

Railway — the services

api, app, rag, and notification run on Railway, each in its own service, built with Railpack (the API builds from its Dockerfile). Services talk to each other — and to their databases — over Railway’s private network (*.railway.internal).

Cloudflare — the web properties

website and docs deploy to Cloudflare Workers — the website via OpenNext, the docs via the @astrojs/cloudflare adapter. Both deploy from main with wrangler.

The Railway services run in three environments end-to-end:

  • development — app.development.huddlesurety.com, api.development.huddlesurety.com. A real, deployed environment (not just local), and blackbox-probed like the others.
  • staging — app.staging.huddlesurety.com, api.staging.huddlesurety.com. The four services deploy here from their staging branch.
  • production — app.huddlesurety.com, api.huddlesurety.com. Deploys from production.

The four services promote staging → production fast-forward only: production is always an exact, already-tested staging commit, and rollback is just pointing production at an older staging SHA.

Promotion happens when a GitHub release is published. Each of the four repos has a release.yaml workflow that fast-forwards production to the release tag’s commit, but only if that commit is on staging and production hasn’t diverged. Railway then deploys production. If production has diverged, the workflow fails and points at mise run promote --force -- <repo> (a workspace task, not a per-repo one). This page used to say there was no separate release pipeline; the release workflow is still only a fast-forward, with no build or checks of its own.

The Cloudflare properties (website, docs) and the shared-infra repos (observability, temporal, litellm) don’t use this flow — they deploy from main on push.

Checks run per repo, where a repo has them. This table used to list tsc, ESLint, and next build as app CI before the app had any check workflow. It has one now (#235). The four Railway service repos (api, app, rag, notification) also have the release.yaml promotion workflow described above. The Cloudflare and shared-infra repos don’t need one, because they deploy from main.

Service Checks
api go test, gofumpt, golangci-lint, OpenAPI docs in sync, schema.sql ↔ migrations in sync; drives SDK generation on staging
app next typegen, mise run tsc (TS7), mise run lint, bun run build (no fmt check; mise run check still runs it locally)
rag pytest (unit), ruff format check, ruff check
notification No checks (release workflow only)
website tsc --noEmit, OpenNext Workers build, wrangler dev smoke test (/ and /privacy must return 200)
docs astro build
observability mise run validate:alloy
temporal docker build of the server and ui images
litellm docker build .

The image builds are checks only. Nothing is pushed to a registry, and Railway still builds from the repo. Dependabot opens weekly update PRs in every repo except notification: api (Go modules, Docker, Actions), app, website and docs (bun, Actions), rag (uv, Actions), and observability, temporal and litellm (Docker, Actions).

The API’s CI additionally generates and publishes the SDKs — see API › SDK generation.

  • Railway + Railpack — the TypeScript and Python services build without a hand-written Dockerfile. The API is the exception: it builds from its Dockerfile, as the Railway card above says. This bullet used to say no service had one. Railpack detects the language and builds; the private @huddlesurety packages install using an injected GITHUB_TOKEN (npm scope for TS services, git-URL rewrite for the Python SDK in rag). RAG’s Railpack config additionally installs poppler-utils and tesseract-ocr for PDF/OCR.
  • API migrations run pre-deploy — the API image ships a ./migrate binary, and each environment’s Railway pre-deploy command runs ./migrate up once before the new version starts; a failed migration halts the deploy and the old version keeps serving. See API › Deployment.
  • Cloudflare Workers — wrangler deploy, from build output (.open-next/ for the website, ./dist for the docs).

Railway service settings — sources, domains, replicas, volumes, pre-deploy commands, variables — are managed in the Railway dashboard (and CLI).

The Railway Postgres and Redis instances have no public URL: they’re reachable only on the private network. To reach one from a laptop, tunnel in with railway connect <service> --tunnel-only. The API wraps this in mise daemons (mise daemons start db-tunnel, started automatically by mise run run) — see API › Reaching the database.