-
Notifications
You must be signed in to change notification settings - Fork 4
50 lines (41 loc) · 1.07 KB
/
build.yaml
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
name: Build and Migrate
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'
- name: Cache Node modules
uses: actions/cache@v3
with:
path: |
./backend/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('backend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
working-directory: ./backend
- name: Build code
run: npm run build
working-directory: ./backend
- name: Set up Prisma
run: npx prisma generate
working-directory: ./backend
- name: Run Prisma Migrate
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: npx prisma migrate deploy
working-directory: ./backend