-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (69 loc) · 2.3 KB
/
Copy pathdeploy.yml
File metadata and controls
83 lines (69 loc) · 2.3 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: CI/CD Pipeline
on:
push:
branches:
- master
jobs:
deploy-backend:
runs-on: ubuntu-latest
name: Deploy Backend to Cloudflare
environment: Production
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: './backend/package-lock.json'
- name: Generate Prisma Client
run: npx prisma generate --no-engine
working-directory: ./backend
- name: Install Backend Dependencies
run: npm ci
working-directory: ./backend
- name: Run Backend Tests
run: npm run test:run
working-directory: ./backend
- name: Deploy to Cloudflare Workers
run: npm run deploy
working-directory: ./backend
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SUPABASE_JWT_SECRET: ${{ secrets.SUPABASE_JWT_SECRET }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
DIRECT_DATABASE_URL: ${{ secrets.DIRECT_DATABASE_URL }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
deploy-frontend:
runs-on: ubuntu-latest
name: Deploy Frontend to Vercel
needs: deploy-backend
environment: Production
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: './frontend/package-lock.json'
- name: Install Frontend Dependencies
run: npm ci
working-directory: ./frontend
- name: Run Frontend Tests
run: npm run test:run
working-directory: ./frontend
- name: Build Frontend
run: npm run build
working-directory: ./frontend
- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}