Skip to content

feat: add Railway deployment target#117

Merged
PAMulligan merged 1 commit into
mainfrom
31-add-railway-deployment-target
Jun 12, 2026
Merged

feat: add Railway deployment target#117
PAMulligan merged 1 commit into
mainfrom
31-add-railway-deployment-target

Conversation

@PAMulligan

Copy link
Copy Markdown
Contributor

Summary

Adds Railway as Nerva's fourth deployment target. Railway builds the service from the same hardened multi-stage Dockerfile as the Node.js target — so the runtime code is fully shared — and railway.toml (config-as-code) wires up the build, /health health check gating each deploy, start command, and restart policy. Managed PostgreSQL connects via Railway's reference variables.

Closes #31

Changes

  • setup-project.sh --railway — reuses the node snippets and node-server Dockerfile/compose (Railway is a Node deployment), adds railway.toml + nixpacks.toml, writes an .env.example documenting Railway's ${{Postgres.DATABASE_URL}} reference-variable syntax, and generates README deployment instructions (project + PostgreSQL setup, Root Directory = api, service variables table, auto-deploy behavior, railway run pnpm db:migrate for migrations, Nixpacks alternative)
  • templates/railway/
    • railway.tomlbuilder = "DOCKERFILE", healthcheckPath = "/health" (failing checks keep the previous deploy live), startCommand, ON_FAILURE restart policy, watch patterns; commented preDeployCommand with the dev-deps caveat
    • nixpacks.toml — pnpm + Node 22 toolchain pins and build/start commands, used when switching builder = "NIXPACKS"
  • No deploy workflow — Railway auto-deploys the connected GitHub repo on push (its core feature), so unlike the Lambda target no GitHub Actions deploy template is needed
  • CItemplates/railway added to the required-dirs check; no new snippets, so no new typecheck step
  • Skills/config/docsdeployment-config-generator Step 2d (Railway config-as-code, env reference table, Root Directory reminder), schema-intake target union + interview option, pipeline.config.json railway block, target mentions across CLAUDE.md/README/onboarding/pipeline docs, railway npm keyword

Test plan

  • bash -n + shellcheck (CI severity) on setup-project.sh; JSON validation of touched configs
  • Both TOML templates parse cleanly (smol-toml), with builder/healthcheck/start values confirmed
  • Generated a real --railway project: 20/20 Vitest tests pass; railway.toml, nixpacks.toml, Dockerfile, docker-compose.yml present; README contains the deployment instructions with literal ${{Postgres.DATABASE_URL}} references
  • Regressions: --node dry-run contains zero Railway files and a real node run earlier this session passes tests; --lambda dry-run unchanged

🤖 Generated with Claude Code

Add --railway to setup-project.sh alongside --cloudflare, --node, and
--lambda. Railway deploys the same multi-stage Docker image as the
Node.js target, so the runtime code is shared: the railway platform
reuses the node snippets and node-server Dockerfile/compose, adding
Railway config-as-code on top.

- templates/railway/: railway.toml (Dockerfile build, /health check,
  start command, restart policy) and nixpacks.toml (pnpm + Node 22
  pins for the non-Docker build)
- setup-project.sh: --railway flag, .env.example with Railway
  reference-variable notes (DATABASE_URL via Postgres reference),
  README deployment instructions (dashboard setup, root directory,
  service variables, auto-deploy, migrations via railway run)
- No deploy workflow generated: Railway auto-deploys the connected
  GitHub repo, gated by the /health check
- CI: require templates/railway; no new snippets to type-check
- deployment-config-generator (Step 2d) and schema-intake skills,
  pipeline.config.json, and docs updated for the fourth target

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@PAMulligan PAMulligan linked an issue Jun 12, 2026 that may be closed by this pull request
7 tasks
@PAMulligan PAMulligan added enhancement New feature or request area: templates Starter templates area: deployment Deployment targets area: scripts Automation scripts labels Jun 12, 2026
@PAMulligan PAMulligan self-assigned this Jun 12, 2026
@github-actions github-actions Bot added area: agents Claude Code agents area: skills Claude Code skills area: pipeline Build pipeline area: ci-cd CI/CD workflows area: docs Documentation labels Jun 12, 2026
@PAMulligan PAMulligan merged commit f8b549d into main Jun 12, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: agents Claude Code agents area: ci-cd CI/CD workflows area: deployment Deployment targets area: docs Documentation area: pipeline Build pipeline area: scripts Automation scripts area: skills Claude Code skills area: templates Starter templates enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Railway deployment target

1 participant