[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EFZFDSB41S54N3HC7R4JSW":3,"skill-same:01M6EFZFDSB41S54N3HC7R4JSW":52},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":25,"linkOnly":26,"markdownContent":27,"markdownBody":27,"frontMatter":28,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":34,"ownerHtmlUrl":35,"ownerBlogUrl":6,"ownerDescription":36,"updatedAt":37,"install":38,"resources":51},"01M6EFZFDSB41S54N3HC7R4JSW","railway-deploy",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",66,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Frailway-deploy\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000011","运维与部署","SCENARIO","使用场景",[23,24],"deploy","railway deploy","2026-11-10 10:12:30",false,"# Railway Deploy\n\n## Overview\n\nDeploy, manage, and monitor applications on Railway using the CLI. Covers the full lifecycle: project setup, service configuration, environment variables, deployments, scaling, logs, and debugging.\n\n## Instructions\n\n### Task A: Project Setup & Linking\n\nFirst verify the CLI is installed. If `railway` is not found, install it:\n\n```bash\nnpm i -g @railway\u002Fcli   # or: brew install railway\n```\n\nCheck if already linked to a project:\n\n```bash\nrailway status\n```\n\nIf not linked, either create a new project or link to an existing one:\n\n```bash\nrailway init    # Create a new project\nrailway link    # Link to an existing project\n```\n\nAfter linking, confirm with `railway status` to verify project, service, and environment context.\n\nFor CI\u002FCD or headless environments, use token auth:\n\n```bash\nRAILWAY_TOKEN=xxx railway up       # Project-scoped token\nRAILWAY_API_TOKEN=xxx railway up   # Account-scoped token\n```\n\n### Task B: Deploy\n\n```bash\n# Deploy current directory and stream logs\nrailway up\n\n# Deploy without waiting for logs\nrailway up --detach\n\n# Target a specific service\nrailway up -s my-service\n\n# Deploy to a specific environment\nrailway up -e staging\n```\n\nTo remove the latest deployment:\n\n```bash\nrailway down\n```\n\nTo redeploy the latest deployment (same code, fresh build):\n\n```bash\nrailway redeploy\n```\n\nTo restart a service without rebuilding:\n\n```bash\nrailway restart\n```\n\n### Task C: Manage Services & Resources\n\n```bash\n# Add a service interactively\nrailway add\n\n# Add a database\nrailway add --database postgres   # also: mysql, redis, mongo\n\n# Add a service from a GitHub repo\nrailway add --repo user\u002Frepo\n\n# Switch linked service context\nrailway service\n\n# Scale a service\nrailway scale\n\n# Generate a Railway subdomain or add a custom domain\nrailway domain\nrailway domain example.com\n\n# Manage persistent volumes\nrailway volume list\nrailway volume add\nrailway volume delete\n\n# Delete the entire project\nrailway delete\n```\n\n### Task D: Environment Variables\n\n```bash\n# List all variables for current service\u002Fenvironment\nrailway variable list\n\n# Set a variable\nrailway variable set DATABASE_URL=postgres:\u002F\u002Fuser:pass@host:5432\u002Fdb\n\n# Set multiple variables\nrailway variable set KEY1=value1 KEY2=value2\n\n# Delete a variable\nrailway variable delete SECRET_KEY\n```\n\n### Task E: Environments\n\n```bash\n# Switch environment interactively\nrailway environment\n\n# Create a new environment\nrailway environment new staging\n\n# Delete an environment\nrailway environment delete dev\n\n# Deploy to a specific environment\nrailway up -e production\n```\n\n### Task F: Logs & Debugging\n\n```bash\n# Stream live logs\nrailway logs\n\n# View build logs\nrailway logs --build\n\n# View last N lines\nrailway logs -n 100\n\n# SSH into the running container\nrailway ssh\n\n# Connect to a database shell (e.g., psql, mysql, redis-cli)\nrailway connect\n```\n\n### Task G: Local Development\n\n```bash\n# Run a command with Railway environment variables injected\nrailway run npm start\nrailway run python manage.py migrate\n\n# Open an interactive shell with Railway env vars\nrailway shell\n```\n\n## Examples\n\n### Example 1: Deploy a Node.js app from scratch\n\n**User request:** \"Deploy my Node.js app to Railway\"\n\n**Actions taken:**\n\n```bash\n$ railway login\n> Opening browser for authentication...\n> Logged in as andrey@example.com\n\n$ railway init\n> Created project \"my-node-app\" in workspace \"Personal\"\n\n$ railway up\n> Uploading 2.3 MB...\n> Build started\n> Installing dependencies...\n> Build completed in 34s\n> Deployment live at my-node-app.up.railway.app\n\n$ railway domain\n> Service domain: my-node-app.up.railway.app\n```\n\n### Example 2: Add a Postgres database and wire it up\n\n**User request:** \"Add a database to my Railway project and set it up\"\n\n**Actions taken:**\n\n```bash\n$ railway status\n> Project: my-node-app\n> Service: web\n> Environment: production\n\n$ railway add --database postgres\n> Added PostgreSQL service to project\n\n# The DATABASE_URL is automatically injected. Verify:\n$ railway variable list\n> DATABASE_URL=postgres:\u002F\u002Frailway:abc123@host:5432\u002Frailway\n> PGHOST=host\n> PGPORT=5432\n> ...\n\n# Run migrations using Railway env vars\n$ railway run npx prisma migrate deploy\n> Applying migrations...\n> 3 migrations applied successfully\n\n$ railway redeploy\n> Redeploying web service...\n> Deployment live\n```\n\n### Example 3: Debug a failing deployment\n\n**User request:** \"My Railway deployment is crashing, help me debug it\"\n\n**Actions taken:**\n\n```bash\n$ railway status\n> Project: my-api\n> Service: web\n> Environment: production\n\n# Check build logs first\n$ railway logs --build\n> Step 4\u002F8: RUN npm ci\n> npm ERR! Could not resolve dependency: peer express@\"^4.0.0\"\n\n# If build passes but runtime fails, check runtime logs\n$ railway logs -n 50\n> Error: connect ECONNREFUSED 127.0.0.1:5432\n\n# Verify variables are set\n$ railway variable list\n> DATABASE_URL=postgres:\u002F\u002F...@localhost:5432\u002Fmydb  # BUG: using localhost\n\n# Fix: point to the Railway-provided database host\n$ railway variable set DATABASE_URL=postgres:\u002F\u002Fuser:pass@railway-db-host:5432\u002Fmydb\n\n$ railway redeploy\n> Redeploying...\n> Deployment live\n```\n\n### Task H: Health Checks and Auto-Rollback\n\nAfter deploying, verify the service is healthy before considering the deploy complete. If unhealthy, roll back to the previous deployment.\n\n```bash\n# Deploy and wait for completion\n$ railway up --detach\n\n# Health check loop — verify the service responds\nHEALTH_URL=\"https:\u002F\u002Fyour-app.railway.app\u002Fapi\u002Fhealth\"\nTIMEOUT=60\nDEADLINE=$((SECONDS + TIMEOUT))\nHEALTHY=false\n\nwhile [ $SECONDS -lt $DEADLINE ]; do\n  STATUS=$(curl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\" \"$HEALTH_URL\" 2>\u002Fdev\u002Fnull || echo \"000\")\n  if [ \"$STATUS\" = \"200\" ]; then\n    HEALTHY=true\n    break\n  fi\n  echo \"Waiting for healthy response... (status: $STATUS)\"\n  sleep 3\ndone\n\nif [ \"$HEALTHY\" = true ]; then\n  echo \"✅ Deployment healthy!\"\nelse\n  echo \"❌ Health check failed! Rolling back...\"\n  railway rollback\n  echo \"⏪ Rolled back to previous deployment\"\nfi\n```\n\n**Automated deploy script with health verification:**\n\n```python\n# deploy_railway.py — Deploy with health check and auto-rollback\nimport subprocess\nimport time\nimport httpx\n\ndef deploy_with_health_check(health_url, timeout=60):\n    \"\"\"Deploy to Railway, verify health, rollback on failure.\"\"\"\n    print(\"? Deploying to Railway...\")\n    subprocess.run([\"railway\", \"up\", \"--detach\"], check=True)\n\n    print(f\"? Health checking {health_url}...\")\n    deadline = time.time() + timeout\n    while time.time() \u003C deadline:\n        try:\n            r = httpx.get(health_url, timeout=5)\n            if r.status_code == 200:\n                print(\"✅ Healthy!\")\n                return True\n        except httpx.RequestError:\n            pass\n        time.sleep(3)\n\n    print(\"❌ Unhealthy! Rolling back...\")\n    subprocess.run([\"railway\", \"rollback\"], check=True)\n    print(\"⏪ Rolled back\")\n    return False\n```\n\n## Guidelines\n\n- Always run `railway status` first to confirm project, service, and environment context before making changes.\n- Use `railway up --detach` in CI\u002FCD pipelines to avoid blocking on log output.\n- Use `RAILWAY_TOKEN` for project-scoped CI\u002FCD auth and `RAILWAY_API_TOKEN` for account-level operations.\n- Use `-s service-name` and `-e environment-name` flags when managing multi-service projects to avoid acting on the wrong target.\n- Use `railway run` to execute one-off commands (migrations, seeds) with production env vars without deploying.\n- If a deployment fails, check build logs (`railway logs --build`) first, then runtime logs (`railway logs`).\n- Use `railway connect` to get a database shell directly without needing connection strings locally.\n- Add `--json` to any command for machine-readable output in scripts.\n- Use `railway variable set` to update env vars, then `railway redeploy` to pick up the changes.\n- Use `railway environment new` to create staging\u002Fpreview environments that mirror production config.\n- If `railway` command is not found, install via `npm i -g @railway\u002Fcli` or `brew install railway`.\n- If `railway login` fails or times out, use `railway login --browserless` for headless\u002FSSH environments.\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Frailway-deploy",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill railway-deploy",{"tool":44,"command":45},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill railway-deploy",{"tool":47,"command":48},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill railway-deploy","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Frailway-deploy\u002FSKILL.md",true,[],[53,65,75,84,90,97],{"skillNo":54,"name":55,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":61,"publishedAt":25},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[58],{"categoryNo":59,"categoryName":60,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发",[62,63,64],"model","model hierarchy","model hierarchy skill",{"skillNo":66,"name":67,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":71,"publishedAt":25},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[70],{"categoryNo":59,"categoryName":60,"taxonomyType":20,"taxonomyTypeDesc":21},[72,73,74],"MCP","zoom","zoom mcp",{"skillNo":76,"name":77,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":25},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[81,82,83,73],"sdk","zoom apps sdk","apps",{"skillNo":85,"name":86,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":25},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[86],{"skillNo":91,"name":92,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":96,"publishedAt":25},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[95],{"categoryNo":59,"categoryName":60,"taxonomyType":20,"taxonomyTypeDesc":21},[92],{"skillNo":98,"name":99,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":25},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[99]]