-
Notifications
You must be signed in to change notification settings - Fork 4
59 lines (48 loc) · 1.36 KB
/
build.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
name: CI/CD
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
services:
mongodb:
image: mongo:latest
ports:
- 27017:27017
options: >-
--health-cmd="mongo --eval 'db.runCommand({ ping: 1 })'"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Cache backend node modules
uses: actions/cache@v2
with:
path: backend/node_modules
key: backend-${{ runner.os }}-node_modules-${{ hashFiles('backend/package-lock.json') }}
restore-keys: |
backend-${{ runner.os }}-node_modules-
- name: Cache frontend node modules
uses: actions/cache@v2
with:
path: frontend/node_modules
key: frontend-${{ runner.os }}-node_modules-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
frontend-${{ runner.os }}-node_modules-
- name: Install backend dependencies
run: cd backend && npm install
- name: Install frontend dependencies
run: cd frontend && npm install
- name: Build frontend
run: cd frontend && npm run build