-
Notifications
You must be signed in to change notification settings - Fork 26
[Price Compare] Step 13: GitHub Actions deploy workflow for Railway #84
Copy link
Copy link
Open
Description
Step 13 — GitHub Actions Deploy Workflow for Railway
Create .github/workflows/deploy.yml — triggered on push to main (after CI passes), deploys to Railway.
Requirements:
- Railway project ID:
c9eeed53-f5d1-4c5e-9eae-68793b4691c9 - Crawler service ID:
74f04ed3-edf6-4293-a47c-82daad7dffa7 - Needs
RAILWAY_TOKENsecret in GitHub repo settings - Should only deploy when CI build succeeds (use
needs: build)
Workflow:
name: Deploy to Railway
on:
push:
branches: ["main"]
jobs:
build:
uses: ./.github/workflows/ci.yml
deploy:
needs: build
runs-on: ubuntu-24.04
if: github.ref == 'refs/heads/main'
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 --service ${{ vars.RAILWAY_SERVICE_ID || '74f04ed3-edf6-4293-a47c-82daad7dffa7' }}Setup steps:
- Generate Railway API token:
railway login→railway tokens create - Add
RAILWAY_TOKENas GitHub Actions secret in repo settings - Optionally add
RAILWAY_SERVICE_IDas GitHub Actions variable - Existing CI workflow (
ci.yml) stays as-is for lint/type checks
Files: .github/workflows/deploy.yml
Priority: P3
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels