diff --git a/.github/workflows/deploy-backend-railway.yml b/.github/workflows/deploy-backend-railway.yml index 5618c278..92eadf06 100644 --- a/.github/workflows/deploy-backend-railway.yml +++ b/.github/workflows/deploy-backend-railway.yml @@ -34,7 +34,7 @@ jobs: github.event.workflow_run.head_branch == 'main' && github.event.workflow_run.head_repository.full_name == github.repository) runs-on: ubuntu-latest - environment: ${{ github.event_name == 'workflow_dispatch' && inputs.channel == 'stable' && 'stable' || 'development' }} + environment: ${{ github.event_name == 'workflow_dispatch' && inputs.channel == 'stable' && 'phaserforge / production' || 'phaserforge / development' }} permissions: contents: read steps: diff --git a/docs/getting-started/railway-deployment.md b/docs/getting-started/railway-deployment.md index 7960d25a..68759bfd 100644 --- a/docs/getting-started/railway-deployment.md +++ b/docs/getting-started/railway-deployment.md @@ -18,13 +18,13 @@ Delete the old shared `VITE_API_BASE_URL` variable after both new variables are These two `VITE_API_BASE_URL_*` variables intentionally remain repository-level variables. The Pages workflow builds both channel artifacts in one job: it needs the development URL while building `/dev/` and the stable URL while building `/stable/`. Vite embeds these values into static JavaScript at build time; Railway environment variables are not available to the published browser bundle. By contrast, `RAILWAY_PUBLIC_URL` is used by one backend deployment job at a time, so it is correctly configured as the same variable name with different values in the GitHub `development` and `stable` environments. -For the Railway workflow, create a GitHub **development** environment and a protected **stable** environment. Add `RAILWAY_TOKEN` as an environment secret to each environment, using that environment's resources. Add the non-sensitive Railway IDs as environment variables: +For the Railway workflow, configure the GitHub environments named exactly `phaserforge / development` and protected `phaserforge / production`. Add `RAILWAY_TOKEN` as an environment secret to each environment, using that environment's resources. Add the non-sensitive Railway IDs as environment variables: - `RAILWAY_PROJECT_ID` - `RAILWAY_ENVIRONMENT_ID` - `RAILWAY_SERVICE_ID` -Add `RAILWAY_PUBLIC_URL` as an environment variable in each GitHub environment. Stable should require reviewers before a deployment job can start. +Add `RAILWAY_PUBLIC_URL` as an environment variable in each GitHub environment. Production should require reviewers before a deployment job can start. ## Railway dashboard configuration diff --git a/tests/deployment/workflow-config.test.ts b/tests/deployment/workflow-config.test.ts index e536e533..049c8c11 100644 --- a/tests/deployment/workflow-config.test.ts +++ b/tests/deployment/workflow-config.test.ts @@ -14,7 +14,7 @@ describe('deployment workflow contract', () => { it('keeps stable backend deployment manual and protected by a stable environment', () => { expect(railwayWorkflow).toContain('workflow_dispatch:'); expect(railwayWorkflow).toContain("inputs.channel == 'stable'"); - expect(railwayWorkflow).toContain("&& 'stable' || 'development'"); + expect(railwayWorkflow).toContain("&& 'phaserforge / production' || 'phaserforge / development'"); expect(railwayWorkflow).toContain('railway up'); expect(railwayWorkflow).toContain('/api/v1/health'); expect(railwayWorkflow).toContain('/api/v1/version');