Railway Provider

Deploy preview environments to Railway services.

How it works

Prerequisites

  1. A Railway account with an existing project and environment.
  2. A Railway API token.

Step 1 — Create a Railway project

  1. Go to railway.appNew Project.
  2. Note the Project ID from the project's settings URL or the Settings → General panel.
  3. Note the Environment ID (found in Settings → Environments → click environment → ID).

Step 2 — Get a Railway API token

  1. Go to Account Settings → Tokens → Create Token.
  2. Give it a descriptive name (e.g. previewops).
  3. Copy the token and store it as RAILWAY_API_TOKEN in the Previewops secrets.

Step 3 — Configure the repo

provider: railway
providerConfig:
  projectId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx     # required — Railway project UUID
  environmentId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx # required — Railway environment UUID

Both IDs are UUIDs. You can find them in the Railway dashboard URL: https://railway.app/project/<projectId>/settings

Step 4 — Verify

Comment /validate-previewops on any open PR. The bot calls { me { id name } } against the Railway GraphQL API and reports the authenticated account name.

Troubleshooting

Error Fix
RAILWAY_API_TOKEN environment variable is required Set the token in your secret store
Railway GraphQL errors: ... Token is expired or lacks project permissions — regenerate
Deployment stuck in BUILDING Railway quota may be exhausted; check the Railway dashboard