Skip to content

Commit 82e37f5

Browse files
authored
fix(workflow): enable Railway deployment from staging branch (#232)
- Add staging branch to workflow triggers - Update environment detection to handle staging and staging/* branches - Fix environment selection for all three jobs (deploy, restore-db, create-admin)
1 parent 0ba93c7 commit 82e37f5

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/deploy_to_railway.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
push:
88
branches:
99
- main
10+
- staging
1011
- 'release/pr-v*'
1112

1213
workflow_dispatch:
@@ -35,7 +36,7 @@ jobs:
3536
deploy-to-railway:
3637
name: Deploy to Railway
3738
runs-on: ubuntu-latest
38-
environment: ${{ inputs.deploy-env || (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || (startsWith(github.ref_name, 'staging/') && 'Staging') || 'None' }}
39+
environment: ${{ inputs.deploy-env || (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || (github.ref_name == 'staging' && 'Staging') || 'None' }}
3940
env:
4041
RAILWAY_TOKEN: ${{ secrets.RAILWAY_GITHUB_ACTIONS }}
4142
steps:
@@ -54,7 +55,7 @@ jobs:
5455
restore-db:
5556
name: Restore DB
5657
needs: deploy-to-railway
57-
environment: ${{ inputs.deploy-env || (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || (startsWith(github.ref_name, 'staging/') && 'Staging') || 'None' }}
58+
environment: ${{ inputs.deploy-env || (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || (github.ref_name == 'staging' && 'Staging') || 'None' }}
5859
runs-on: ubuntu-latest
5960
if: ${{ inputs.restore-db == true }}
6061
env:
@@ -74,7 +75,7 @@ jobs:
7475
needs: restore-db
7576
if: ${{ inputs.create-admin == true }}
7677
runs-on: ubuntu-latest
77-
environment: ${{ inputs.deploy-env || (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || (startsWith(github.ref_name, 'staging/') && 'Staging') || 'None' }}
78+
environment: ${{ inputs.deploy-env || (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || (github.ref_name == 'staging' && 'Staging') || 'None' }}
7879
env:
7980
APOS_MONGODB_URI: ${{ secrets.MONGO_URI }}
8081
ADMIN_PASSWORD: ${{ secrets.ADMIN_PASSWORD }}

0 commit comments

Comments
 (0)