Skip to content

Commit 036339e

Browse files
committed
ci: use Railway API token for deploy auth
1 parent 4a4d9e9 commit 036339e

3 files changed

Lines changed: 4 additions & 31 deletions

File tree

‎.github/workflows/deploy.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ jobs:
2323

2424
- name: Verify Railway secrets
2525
run: |
26-
test -n "$RAILWAY_TOKEN" || (echo "Missing RAILWAY_TOKEN GitHub repository secret" && exit 1)
26+
test -n "$RAILWAY_API_TOKEN" || (echo "Missing RAILWAY_API_TOKEN GitHub repository secret" && exit 1)
2727
test -n "$RAILWAY_PROJECT_ID" || (echo "Missing RAILWAY_PROJECT_ID GitHub repository secret" && exit 1)
2828
test -n "$RAILWAY_SERVICE_ID" || (echo "Missing RAILWAY_SERVICE_ID GitHub repository secret" && exit 1)
2929
env:
30-
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
30+
RAILWAY_API_TOKEN: ${{ secrets.RAILWAY_API_TOKEN }}
3131
RAILWAY_PROJECT_ID: ${{ secrets.RAILWAY_PROJECT_ID }}
3232
RAILWAY_SERVICE_ID: ${{ secrets.RAILWAY_SERVICE_ID }}
3333

@@ -40,7 +40,7 @@ jobs:
4040
- name: Deploy to Railway
4141
run: railway up --project "$RAILWAY_PROJECT_ID" --service "$RAILWAY_SERVICE_ID" --environment production --ci
4242
env:
43-
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
43+
RAILWAY_API_TOKEN: ${{ secrets.RAILWAY_API_TOKEN }}
4444
RAILWAY_PROJECT_ID: ${{ secrets.RAILWAY_PROJECT_ID }}
4545
RAILWAY_SERVICE_ID: ${{ secrets.RAILWAY_SERVICE_ID }}
4646

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ flowchart TD
187187
- **Backend → Railway** - `railway up` is run **from the repo root**, not `backend/`, because the Railway service is already configured with `Root Directory=/backend`; uploading the full repo lets Railway apply that configured root itself. Railway's own pre-deploy step (`npm run migration:run:prod`) handles production migrations - CI's `migration:run` is only there to validate migrations apply cleanly, not to apply them to production.
188188
- **Frontend → Cloudflare Pages** - built with `VITE_API_BASE_URL` pointed at production, then pushed with **Direct Upload** (`npx wrangler pages deploy dist --project-name simple-invoice --branch main`). This deliberately does **not** use Cloudflare's Git integration or `wrangler deploy` (that command targets Workers, not Pages).
189189

190-
Required GitHub repository secrets: `CLOUDFLARE_ACCOUNT_ID`, `CLOUDFLARE_API_TOKEN`, `RAILWAY_TOKEN`, `RAILWAY_PROJECT_ID`, `RAILWAY_SERVICE_ID`. If any of these are missing or empty, `deploy.yml` fails before starting the deploy and prints the missing secret name.
190+
Required GitHub repository secrets: `CLOUDFLARE_ACCOUNT_ID`, `CLOUDFLARE_API_TOKEN`, `RAILWAY_API_TOKEN`, `RAILWAY_PROJECT_ID`, `RAILWAY_SERVICE_ID`. If any of these are missing or empty, `deploy.yml` fails before starting the deploy and prints the missing secret name.
191191

192192
The Railway deploy pins `@railway/cli@5.2.0` so production deploys are not affected by unexpected CLI changes from the latest release.
193193

‎frontend/README.md‎

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -474,33 +474,6 @@ See backend README (`backend/README.md`) for endpoint details, query params, and
474474

475475
---
476476

477-
## Getting Started
478-
479-
See root `README.md` for setup instructions (Docker or local).
480-
481-
**Quick start:**
482-
483-
```bash
484-
# Install dependencies
485-
npm install
486-
487-
# Start dev server
488-
npm run dev
489-
490-
# In another terminal, start backend (see backend README)
491-
cd ../backend
492-
npm install
493-
npm run migration:run
494-
npm run seed
495-
npm run start
496-
497-
# Frontend is now at http://localhost:5173
498-
# Backend is at http://localhost:4000
499-
# Swagger UI at http://localhost:4000/api/docs
500-
```
501-
502-
---
503-
504477
## Code Quality
505478

506479
- **TypeScript strict mode** - All code is typed; no `any`.

0 commit comments

Comments
 (0)