Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy-backend-railway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started/railway-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/deployment/workflow-config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Loading