86304d82 days ago459 CommitsThis project defines its Railway infrastructure in code.
.railway/railway.ts
Use this file to describe the Railway project you want: services, databases, buckets, custom domains, replicas, groups, and environment variables.
The TypeScript file imports railway/iac. Install the SDK from the repository root:
npm install railway
Create the configuration files:
railway config init
Import an existing Railway project into code:
railway config pull
Preview what Railway would change:
railway config plan
Apply the planned changes:
railway config apply
railway config plan is safe and does not change Railway.railway config apply previews changes and asks before applying unless you pass --yes.railway config apply --confirm-destructive after reviewing the plan.railway config plan --out railway-plan.json) and apply that file on merge (railway config apply --plan railway-plan.json --yes --confirm-destructive) so the reviewed change set is what lands. On GitHub Actions, use https://github.com/railwayapp/config.railway.json must be migrated before .railway/railway.ts can manage them..railway file for the whole project. A named export const partial (or PARTIAL / const Partial) is a last resort for separate repos that cannot share that file. Do not add it unless omit=delete across repos is a blocker.replicas for scaling; advanced placement can still specify region names.group("Name", [resources]) to keep large projects organized on the Railway canvas.preserve() so existing values are retained without writing secret values to source. Use railway config pull --omit-preserved-variables for a smaller import. railway config pull --include-variables decrypts and inlines non-sealed values (including secrets that were never sealed).railway config migrate finds every railway.json / railway.toml in the repository and writes them into this one file.