Railway deploy

From elophanto/EloPhanto · View interactive version

Railway deploy is an AI agent skill from the GitHub repository elophanto/EloPhanto. Deploy applications and backends to Railway. Handles long-running processes,

How to use this skill

Skill file

Deploy to Railway

Description

Deploy applications and backends to Railway. Handles long-running processes,

WebSockets, cron jobs, and LLM API calls with no timeout limits.

Triggers

Instructions

When to Use Railway

Railway is the right choice for:

Deploy Workflow

  1. Build locally first — always run npm run build (or equivalent) before

deploying. Fix all build errors locally.

  1. Create database if needed — if the project needs persistence, call

create_database with a project name. It returns url, anon_key,

service_role_key, and db_url automatically. **Never ask the user for

Supabase keys** — they are auto-generated.

  1. Deploy using the deploy_website tool:

```

deploy_website(

project_path="/path/to/project",

provider="railway",

name="my-api", # optional

env_vars={ # from create_database result + any other vars

"DATABASE_URL": db_url,

"SUPABASE_SERVICE_ROLE_KEY": service_role_key,

"OPENAI_API_KEY": "...", # or any other env vars the app needs

}

)

```

  1. Verify — check the returned URL or use deployment_status to confirm.

Token Setup

The deploy_website tool reads the Railway token from the vault automatically.

If not set, it will tell the user what to do:

vault_set key=railway_token value=YOUR_TOKEN

Get the token at: railway.com → Account Settings → Tokens → Create Token.

The Railway CLI must be installed: npm install -g @railway/cli

How It Works Under the Hood

The deploy_website tool runs:

# Set env vars
RAILWAY_TOKEN=$TOKEN railway variables set KEY1=VAL1 KEY2=VAL2

# Deploy (detached — returns immediately)
RAILWAY_TOKEN=$TOKEN railway up --detach

# Get the public URL
RAILWAY_TOKEN=$TOKEN railway domain

Railway Free Tier

Project Types That Need Railway

| Pattern in Code | Why Railway |

|----------------|-------------|

| import openai / import anthropic | LLM calls take 10-60s |

| ReadableStream / EventSource | Streaming responses |

| WebSocket / socket.io / ws | Persistent connections |

| setTimeout > 10s | Long timers |

| bullmq / pg-boss | Background job queues |

| Procfile exists | Custom server process |

| cron / scheduled tasks | Recurring jobs |

Anti-Patterns

returns them automatically.

for static content with global CDN.

Verify

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.