-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (74 loc) · 2.33 KB
/
Copy pathdeploy.yml
File metadata and controls
96 lines (74 loc) · 2.33 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
84
85
86
87
88
89
90
91
92
93
94
95
96
name: CI/CD → DEVOS
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
jobs:
ci:
name: Type Check & Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: client/package-lock.json
- name: Install dependencies
working-directory: client
run: npm install
- name: Type check
working-directory: client
run: npx tsc -b --noEmit
- name: Build
working-directory: client
run: npm run build
deploy-preview:
name: Deploy Preview
runs-on: ubuntu-latest
needs: ci
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: client/package-lock.json
- name: Install dependencies
working-directory: client
run: npm install
- name: Install Vercel CLI
run: npm i -g vercel
- name: Pull Vercel environment
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy to Vercel Preview
run: vercel deploy --token=${{ secrets.VERCEL_TOKEN }} --yes >> $GITHUB_STEP_SUMMARY
deploy-production:
name: Deploy Production
runs-on: ubuntu-latest
needs: ci
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: client/package-lock.json
- name: Install dependencies
working-directory: client
run: npm install
- name: Install Vercel CLI
run: npm i -g vercel
- name: Pull Vercel environment
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy to Vercel Production
run: vercel deploy --prod --token=${{ secrets.VERCEL_TOKEN }} --yes >> $GITHUB_STEP_SUMMARY