-
Notifications
You must be signed in to change notification settings - Fork 401
102 lines (87 loc) · 2.41 KB
/
frontend-deploy-production.yml
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
97
98
99
100
101
102
name: Frontend Deploy to Production
on:
push:
branches:
- main
paths:
- frontend/**
- .github/**
defaults:
run:
working-directory: frontend
jobs:
run-tests:
runs-on: ubuntu-latest
name: Run E2E Tests
environment: production
concurrency:
group: e2e-tests-prod
cancel-in-progress: true
steps:
- name: Cloning repo
uses: actions/checkout@v4
- name: Run E2E tests against production
uses: ./.github/actions/e2e-tests
with:
e2e_test_token: ${{ secrets.E2E_TEST_TOKEN }}
slack_token: ${{ secrets.SLACK_TOKEN }}
environment: prod
deploy-production:
runs-on: ubuntu-latest
name: Deploy to Vercel Production
environment: production
needs: run-tests
steps:
- name: Cloning repo
uses: actions/checkout@v4
- name: Setup Node.js 16.x
uses: actions/setup-node@v4
with:
node-version: 16.x
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- name: Deploy to Vercel
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
ENV: prod
run: |
npm ci --only=prod
npm run env
npm run bundle
echo ${{ github.sha }} > CI_COMMIT_SHA
vercel --prod --token ${{ secrets.VERCEL_TOKEN }}
deploy-demo:
runs-on: ubuntu-latest
name: Deploy to Vercel Demo
environment: demo
needs: run-tests
steps:
- name: Cloning repo
uses: actions/checkout@v4
- name: Setup Node.js 16.x
uses: actions/setup-node@v4
with:
node-version: 16.x
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- name: Deploy to Vercel
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
ENV: prod
run: |
npm ci --only=prod
npm run env
npm run bundle
echo ${{ github.sha }} > CI_COMMIT_SHA
npm install --global [email protected]
vercel --prod --token ${{ secrets.VERCEL_TOKEN }}