-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (46 loc) · 1.42 KB
/
Copy pathci-deploy.yml
File metadata and controls
61 lines (46 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: CI & Deploy
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.6"
- name: Install dependencies
run: bun install
- name: Build shared package
run: cd packages/shared && bun run build
- name: Generate Prisma client
run: cd backend && bun x prisma generate
- name: Type check backend
run: cd backend && bun x tsc -p tsconfig.build.json --noEmit
- name: Type check frontend
run: cd apps/web && bun x tsc --noEmit
- name: Run backend tests
run: cd backend && bun run test
- name: Run frontend tests
run: cd apps/web && bun run test
deploy-backend:
name: Deploy Backend
needs: test
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Railway CLI
run: npm install -g @railway/cli
- name: Deploy backend to Railway
run: railway up --service ${{ vars.RAILWAY_SERVICE_NAME }}
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
# Frontend deploys automatically via Vercel git integration