From 952c8b1d34de793d5950c28354c7b7b97997f2f7 Mon Sep 17 00:00:00 2001 From: Ihor Masechko Date: Mon, 22 Dec 2025 11:01:20 +0200 Subject: [PATCH 1/2] fix(workflow): enable Railway deployment from staging branch - 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) --- .github/workflows/deploy_to_railway.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy_to_railway.yml b/.github/workflows/deploy_to_railway.yml index 9a07ccd1..8ffe5843 100644 --- a/.github/workflows/deploy_to_railway.yml +++ b/.github/workflows/deploy_to_railway.yml @@ -7,6 +7,7 @@ on: push: branches: - main + - staging - 'release/pr-v*' workflow_dispatch: @@ -35,7 +36,7 @@ jobs: deploy-to-railway: name: Deploy to Railway runs-on: ubuntu-latest - environment: ${{ inputs.deploy-env || (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || (startsWith(github.ref_name, 'staging/') && 'Staging') || 'None' }} + environment: ${{ inputs.deploy-env || (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || ((github.ref_name == 'staging' || startsWith(github.ref_name, 'staging/')) && 'Staging') || 'None' }} env: RAILWAY_TOKEN: ${{ secrets.RAILWAY_GITHUB_ACTIONS }} steps: @@ -54,7 +55,7 @@ jobs: restore-db: name: Restore DB needs: deploy-to-railway - environment: ${{ inputs.deploy-env || (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || (startsWith(github.ref_name, 'staging/') && 'Staging') || 'None' }} + environment: ${{ inputs.deploy-env || (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || ((github.ref_name == 'staging' || startsWith(github.ref_name, 'staging/')) && 'Staging') || 'None' }} runs-on: ubuntu-latest if: ${{ inputs.restore-db == true }} env: @@ -74,7 +75,7 @@ jobs: needs: restore-db if: ${{ inputs.create-admin == true }} runs-on: ubuntu-latest - environment: ${{ inputs.deploy-env || (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || (startsWith(github.ref_name, 'staging/') && 'Staging') || 'None' }} + environment: ${{ inputs.deploy-env || (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || ((github.ref_name == 'staging' || startsWith(github.ref_name, 'staging/')) && 'Staging') || 'None' }} env: APOS_MONGODB_URI: ${{ secrets.MONGO_URI }} ADMIN_PASSWORD: ${{ secrets.ADMIN_PASSWORD }} From f5476346fb6cccb24229705ed1e455f6f7deb539 Mon Sep 17 00:00:00 2001 From: Ihor Masechko Date: Mon, 22 Dec 2025 11:53:45 +0200 Subject: [PATCH 2/2] fix(workflow): remove staging/* pattern from environment detection --- .github/workflows/deploy_to_railway.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy_to_railway.yml b/.github/workflows/deploy_to_railway.yml index 8ffe5843..d0d76b9e 100644 --- a/.github/workflows/deploy_to_railway.yml +++ b/.github/workflows/deploy_to_railway.yml @@ -36,7 +36,7 @@ jobs: deploy-to-railway: name: Deploy to Railway runs-on: ubuntu-latest - environment: ${{ inputs.deploy-env || (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || ((github.ref_name == 'staging' || startsWith(github.ref_name, 'staging/')) && 'Staging') || 'None' }} + environment: ${{ inputs.deploy-env || (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || (github.ref_name == 'staging' && 'Staging') || 'None' }} env: RAILWAY_TOKEN: ${{ secrets.RAILWAY_GITHUB_ACTIONS }} steps: @@ -55,7 +55,7 @@ jobs: restore-db: name: Restore DB needs: deploy-to-railway - environment: ${{ inputs.deploy-env || (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || ((github.ref_name == 'staging' || startsWith(github.ref_name, 'staging/')) && 'Staging') || 'None' }} + environment: ${{ inputs.deploy-env || (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || (github.ref_name == 'staging' && 'Staging') || 'None' }} runs-on: ubuntu-latest if: ${{ inputs.restore-db == true }} env: @@ -75,7 +75,7 @@ jobs: needs: restore-db if: ${{ inputs.create-admin == true }} runs-on: ubuntu-latest - environment: ${{ inputs.deploy-env || (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || ((github.ref_name == 'staging' || startsWith(github.ref_name, 'staging/')) && 'Staging') || 'None' }} + environment: ${{ inputs.deploy-env || (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || (github.ref_name == 'staging' && 'Staging') || 'None' }} env: APOS_MONGODB_URI: ${{ secrets.MONGO_URI }} ADMIN_PASSWORD: ${{ secrets.ADMIN_PASSWORD }}