-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.35 KB
/
pipeline.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
name: Software Programming Quiz CI/CD
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
PORT: ${{ secrets.PORT }}
MONGO_URI: ${{ secrets.MONGO_URI }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
JWT_EXPIRE: ${{ secrets.JWT_EXPIRE }}
EMAIL_SERVICE: ${{ secrets.EMAIL_SERVICE }}
EMAIL_USERNAME: ${{ secrets.EMAIL_USERNAME }}
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }}
EMAIL_FROM: ${{ secrets.EMAIL_FROM }}
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout code
uses: actions/checkout@v3
# Build the backend
- name: Build and Test Backend
env:
PORT: ${{ secrets.PORT }}
MONGO_URI: ${{ secrets.MONGO_URI }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
JWT_EXPIRE: ${{ secrets.JWT_EXPIRE }}
EMAIL_SERVICE: ${{ secrets.EMAIL_SERVICE }}
EMAIL_USERNAME: ${{ secrets.EMAIL_USERNAME }}
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }}
EMAIL_FROM: ${{ secrets.EMAIL_FROM }}
working-directory: backend
run: |
npm ci
npm run test
# Build the frontend
- name: Build and Test Frontend
working-directory: frontend
run: |
npm ci --legacy-peer-deps --no-fund
npm run build
npm run test