-
Notifications
You must be signed in to change notification settings - Fork 4
44 lines (37 loc) · 961 Bytes
/
cicd.yml
File metadata and controls
44 lines (37 loc) · 961 Bytes
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
name: Deploy Next to Vercel
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install dependencies
run: npm install
working-directory: carbontrack
- name: Run tests
run: npm test
working-directory: carbontrack
- name: Build Next app
run: npm run build
working-directory: carbontrack
env:
NODE_OPTIONS: --max-old-space-size=4096
- name: Deploy to Vercel
if: github.ref == 'refs/heads/main'
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: npx vercel --prod --confirm --token $VERCEL_TOKEN
working-directory: carbontrack