Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计异常

railway-deployment铁路部署

Agent Skill

用于辅助云资源、部署、容器、基础设施和运维自动化任务。它适合让 Agent 检查配置、整理部署步骤、分析资源状态、生成排障思路或辅助云服务接入。使用时需要明确目标环境、账号权限、区域和资源组,区分本地测试与生产操作;涉及删除资源、重启服务、修改网络或权限配置时,应先确认影响范围。

总安装

419

周安装

18

GitHub Stars

9

下载量

147
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:railway-deployment(铁路部署)
来源仓库:https://github.com/adaptationio/skrillz
仓库路径:skills/railway-deployment
安装命令:
npx skills add https://github.com/adaptationio/skrillz --skill railway-deployment
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/adaptationio/skrillz --skill railway-deployment

简介

railway-deployment 提供 Railway.com 平台的完整部署管理功能,包括发布、回滚和健康验证。

  • 适用于从 GitHub、Docker 镜像或本地目录自动部署服务到 Railway 环境。
  • 支持实时监控日志、构建进度及健康检查,确保部署稳定性。
  • 需提前安装 Railway CLI 并完成认证,项目需已关联目标服务。
  • 涉及生产环境操作时应谨慎,建议先在 staging 环境验证流程。

SKILL.md

Railway Deployment Management

Complete deployment workflows for Railway.com including deployment from multiple sources, rollback strategies, health verification, and staging-to-production promotion.

Overview

This skill provides comprehensive deployment management for Railway:

  • Deploy from sources: GitHub auto-deploy, Docker images, local directory
  • Monitor deployments: Real-time logs, status tracking, build progress
  • Verify health: Automated health checks and validation
  • Rollback strategies: Safe rollback to previous deployments
  • Environment management: Staging → production workflows
  • CI/CD integration: Automated deployment pipelines

Prerequisites

  • Railway CLI installed and authenticated (use railway-auth skill)
  • Project linked (use railway-project-management skill)
  • Service created in target environment

When to Use

  • Deploying new code to Railway
  • Redeploying after configuration changes
  • Rolling back failed deployments
  • Promoting staging to production
  • Setting up automated deployments
  • Monitoring deployment progress
  • Verifying deployment health

5-Step Deployment Workflow

Step 1: Prepare Deployment

Verify authentication, project context, and service health before deploying.

Commands:

# Verify authentication
railway whoami

# Check project and environment context
railway status

# List services in current environment
railway list

# Check current deployment status
railway status --json

Pre-deployment checklist:

  • Authenticated with Railway
  • Correct project linked
  • Target environment selected
  • Service exists in environment
  • No pending deployments
  • Environment variables set

Use automation:

.claude/skills/railway-deployment/scripts/pre-deploy-check.sh

Step 2: Deploy

Deploy from GitHub, Docker, or local directory.

Deploy from GitHub (Auto-Deploy)

Setup auto-deploy:

# Link service to GitHub repo
railway add --repo owner/repository

# Configure branch (via dashboard or railway.json)
railway open

Trigger deployment:

# Push to configured branch
git push origin main

# Railway automatically deploys
# Monitor in real-time:
railway logs --deployment

Manual redeploy:

# Redeploy latest commit
railway redeploy

# Redeploy specific deployment ID
railway redeploy --deployment <deployment-id>

Deploy from Local Directory

Deploy current directory:

# Deploy and wait for completion
railway up

# Deploy without waiting (detached)
railway up --detach

# Deploy in CI mode (build logs only)
railway up --ci

# Deploy specific service
railway up --service backend

What happens:

  1. CLI uploads local directory to Railway
  2. Railway detects build configuration (Nixpacks/Dockerfile)
  3. Build starts automatically
  4. Deployment triggers on successful build
  5. Service restarts with new code

Deploy from Docker Image

Public image:

# Deploy Docker Hub image
railway add --image postgres:15

# Deploy with tag
railway add --image myapp/backend:v1.2.3

Private registry:

# Set registry credentials
railway variables set --sealed DOCKER_USERNAME=user
railway variables set --sealed DOCKER_PASSWORD=pass

# Deploy from private registry
railway add --image registry.example.com/app:latest

Update image tag (rollback/upgrade):

# Via environment variable
railway variables set IMAGE_TAG=v1.2.2

# Force redeploy with new tag
railway redeploy

See references/deployment-sources.md for detailed configuration.


Step 3: Monitor Deployment

Track deployment progress and identify issues in real-time.

Real-time logs:

# Follow deployment logs
railway logs --deployment

# Filter by service
railway logs --service backend --deployment

# Show last 100 lines
railway logs --tail 100

# Include timestamps
railway logs --timestamps

Deployment status:

# Check deployment status
railway status

# Get detailed JSON status
railway status --json | jq '.deployments[0]'

# List recent deployments
railway list deployments

# Check specific deployment
railway deployment <deployment-id>

Build progress indicators:

Building... ████████░░░░░░░░ 60%
Installing dependencies...
Running build script...
Optimizing assets...

Watch for issues:

  • Build failures (missing dependencies)
  • Environment variable errors
  • Port binding issues
  • Memory/CPU limits exceeded
  • Health check failures

Automated monitoring:

# Monitor and alert on failures
.claude/skills/railway-deployment/scripts/monitor-deployment.sh

Step 4: Verify Deployment

Validate that deployment is healthy and functioning correctly.

Health check commands:

# Check service health endpoint
curl https://your-service.railway.app/health

# Verify with custom validation
.claude/skills/railway-deployment/scripts/verify-health.sh

Validation checklist:

  • Service is running (not crashed)
  • Health endpoint returns 200 OK
  • Environment variables loaded correctly
  • Database connections established
  • API endpoints responding
  • Static assets loading
  • No error logs present

Automated validation:

# Run full health check suite
.claude/skills/railway-deployment/scripts/deploy.sh --verify

# Output:
# ✅ Service running
# ✅ Health check passed (200 OK)
# ✅ Environment variables loaded
# ✅ Database connection successful
# ✅ API responding correctly

Common validation issues:

IssueSymptomSolution
Service not startingStatus: "crashed"Check logs for startup errors
Health check failing503 Service UnavailableVerify health endpoint path
Variables missingApplication errorsCheck railway variables list
Port binding error"EADDRINUSE"Ensure PORT variable used
Database connection"ECONNREFUSED"Verify DATABASE_URL set

Step 5: Rollback if Needed

Safely rollback to previous deployment if issues are detected.

Quick rollback:

# Redeploy previous deployment
railway redeploy --deployment <previous-deployment-id>

# List recent deployments to find ID
railway list deployments

Automated rollback:

# Rollback with safety checks
.claude/skills/railway-deployment/scripts/rollback.sh

# Rollback to specific version
.claude/skills/railway-deployment/scripts/rollback.sh v1.2.3

Rollback strategies:

  1. Redeploy Previous Commit (GitHub): # Find previous working commit git log --oneline # Revert to previous commit git revert HEAD git push origin main # Railway auto-deploys
  2. Redeploy Previous Deployment (any source): # List deployments railway list deployments # Redeploy specific deployment ID railway redeploy --deployment dep_abc123xyz
  3. Docker Image Tag Rollback: # Update image tag to previous version railway variables set IMAGE_TAG=v1.2.2 # Redeploy with previous tag railway redeploy
  4. Environment Variable Rollback: # Restore previous variable values railway variables set API_VERSION=v1 railway variables set FEATURE_FLAGS=old-config # Redeploy with previous config railway redeploy

See references/rollback-strategies.md for detailed rollback procedures.

Rollback verification:

# After rollback, verify health
.claude/skills/railway-deployment/scripts/verify-health.sh

# Check logs for errors
railway logs --tail 50

# Verify specific functionality
curl https://your-service.railway.app/api/test

Staging → Production Workflow

Typical promotion flow:

# 1. Deploy to staging first
railway environment staging
railway up

# 2. Verify staging deployment
.claude/skills/railway-deployment/scripts/verify-health.sh

# 3. Run staging tests
npm run test:staging

# 4. Promote to production
railway environment production

# 5. Deploy same code
railway up

# 6. Verify production
.claude/skills/railway-deployment/scripts/verify-health.sh

# 7. Monitor production logs
railway logs --deployment

Automated staging workflow:

# Complete staging → production workflow
.claude/skills/railway-deployment/scripts/promote-to-production.sh

See references/staging-workflow.md for detailed staging strategies.


CI/CD Integration

GitHub Actions

name: Deploy to Railway
on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Railway CLI
        run: npm install -g @railway/cli

      - name: Deploy to Railway
        env:
          RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
        run: |
          railway up --ci

      - name: Verify Deployment
        run: |
          sleep 30
          curl -f https://your-service.railway.app/health || exit 1

GitLab CI

deploy:staging:
  stage: deploy
  image: node:20
  script:
    - npm install -g @railway/cli
    - railway environment staging
    - railway up --ci
  environment:
    name: staging
  only:
    - develop

deploy:production:
  stage: deploy
  image: node:20
  script:
    - npm install -g @railway/cli
    - railway environment production
    - railway up --ci
  environment:
    name: production
  only:
    - main
  when: manual

Advanced Deployment Patterns

Blue-Green Deployment

# 1. Deploy to "green" environment
railway environment green
railway up

# 2. Verify green is healthy
.claude/skills/railway-deployment/scripts/verify-health.sh

# 3. Switch traffic to green
# (Update DNS or load balancer)

# 4. Keep blue as rollback option
railway environment blue
# (Don't delete until green is stable)

Canary Deployment

# 1. Deploy canary version
railway environment canary
railway up

# 2. Route small % of traffic to canary
# (Configure via load balancer)

# 3. Monitor canary metrics
railway logs --service canary

# 4. Gradually increase traffic
# (Adjust load balancer weights)

# 5. Promote to production if successful
railway environment production
railway up

Rolling Deployment

# Deploy to instances one at a time
# (Requires horizontal scaling)

# Railway handles rolling deploys automatically
# when multiple replicas are configured
railway up

# Monitors health and rolls back on failure

Deployment Troubleshooting

Build Failures

# Check build logs
railway logs --deployment

# Common issues:
# - Missing package.json
# - Node/Python version mismatch
# - Build command failures
# - Environment variables not set

# Fix and redeploy
railway up

Deployment Stuck

# Check deployment status
railway status --json

# Cancel stuck deployment
railway deployment cancel <deployment-id>

# Redeploy
railway up

Health Check Failures

# Check service logs
railway logs

# Verify health endpoint exists
curl -v https://your-service.railway.app/health

# Check port configuration
railway variables list | grep PORT

# Verify restart policy
railway open  # Check service settings

Memory/CPU Limits

# Check resource usage
railway metrics

# Increase limits (via dashboard)
railway open

# Or upgrade plan

Quick Reference

Core Deployment Commands

CommandDescription
railway upDeploy local directory
railway up --detachDeploy without waiting
railway up --ciDeploy in CI mode
railway redeployRedeploy latest deployment
railway logs --deploymentMonitor deployment logs
railway statusCheck deployment status

Deployment Sources

SourceCommandAuto-Deploy
GitHubrailway add --repo owner/repo✅ Yes (on push)
Localrailway up❌ Manual
Dockerrailway add --image image:tag❌ Manual

Environment Workflow

# Staging
railway environment staging
railway up

# Production
railway environment production
railway up

Automated Scripts

Smart Deployment with Health Checks

# Deploy with automatic health verification
.claude/skills/railway-deployment/scripts/deploy.sh

# Deploy specific service
.claude/skills/railway-deployment/scripts/deploy.sh backend

# Deploy with custom health endpoint
.claude/skills/railway-deployment/scripts/deploy.sh backend /api/health

Safe Rollback

# Rollback with confirmation prompt
.claude/skills/railway-deployment/scripts/rollback.sh

# Rollback to specific deployment
.claude/skills/railway-deployment/scripts/rollback.sh dep_abc123

# Emergency rollback (no confirmation)
.claude/skills/railway-deployment/scripts/rollback.sh --force

Pre-Deployment Validation

# Check all prerequisites
.claude/skills/railway-deployment/scripts/pre-deploy-check.sh

# Validates:
# - Railway authentication
# - Project linked
# - Environment selected
# - No pending deployments
# - Variables configured

Related Skills

  • railway-auth: Authenticate with Railway CLI and manage tokens
  • railway-project-management: Create projects, manage environments, configure variables
  • railway-observability: Monitor metrics, logs, and traces
  • railway-api: GraphQL API automation for advanced workflows

Additional Resources

  • References:

- references/deployment-sources.md: GitHub, Docker, and local deployment details - references/rollback-strategies.md: Comprehensive rollback procedures - references/staging-workflow.md: Staging → production best practices

  • Scripts:

- scripts/deploy.sh: Smart deployment with health checks - scripts/rollback.sh: Safe rollback with confirmation - scripts/verify-health.sh: Automated health validation - scripts/pre-deploy-check.sh: Pre-deployment validation - scripts/promote-to-production.sh: Staging → production automation

  • Railway Documentation:

- Deployments - CLI Commands - GitHub Integration - Docker Deployments


Last Updated: November 2025 Status: Production-ready Version: 1.0.0

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

github-copilot

29.1%
按下载量换算43

Claude Code

22.71%
按下载量换算33

mcpjam

16.62%
按下载量换算24

moltbot

10.67%
按下载量换算16

windsurf

7.94%
按下载量换算12

zencoder

3.16%
按下载量换算5

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills