Wiring Railway deploys → pgblame
Two ways depending on your Railway plan.
Option A: Railway native webhook (Pro+)
- In your Railway project: Settings → Webhooks → Create.
- URL:
https://pgblame.com/v1/deploy/railway?token=<your-pgblame-project-token> - Trigger: Deployment Succeeded.
- Save. Copy the signing secret Railway provides.
- In pgblame: Project settings → Webhook signing secrets → Railway.
Option B: Generic curl in a deploy command
Add to your railway.json:
{
"deploy": {
"startCommand": "your-app-start-command",
"healthcheckPath": "/healthz",
"preDeployCommand": [
"curl -fsS -X POST \"https://pgblame.com/v1/deploy?token=${PGBLAME_TOKEN}\" -H 'Content-Type: application/json' -d \"{\\\"source\\\":\\\"railway\\\",\\\"ref\\\":\\\"${RAILWAY_GIT_BRANCH}\\\",\\\"commit_sha\\\":\\\"${RAILWAY_GIT_COMMIT_SHA}\\\"}\""
]
}
}Set PGBLAME_TOKEN in Railway's environment variables.
Verifying
Trigger a deploy. After ~30 seconds the deploy should appear on the Timeline. If not: check the token, check that pgblame has any data ingested (timeline is empty by design without snapshots), and check Railway's webhook logs.