-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (54 loc) · 1.65 KB
/
node.js.yml
File metadata and controls
60 lines (54 loc) · 1.65 KB
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
name: Node.js CI
on:
push:
branches: ['master', 'dev']
pull_request:
branches: ['master', 'dev']
jobs:
test:
env:
DATABASE_URL: mysql://prisma:prisma@localhost:3306/prisma
JWT_SECRET: ${{ secrets.JWT_SECRET }}
JWT_REFRESH_SECRET: ${{ secrets.JWT_REFRESH_SECRET }}
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }}
EMAIL_USERNAME: ${{ secrets.EMAIL_USERNAME }}
TEST_EMAIL: ${{ secrets.TEST_EMAIL }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
services:
mysql:
image: mysql:8.0
env:
MYSQL_USER: prisma
MYSQL_PASSWORD: prisma
MYSQL_DATABASE: prisma
MYSQL_ROOT_PASSWORD: prisma
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
working-directory: backend
run: npm ci
- name: Build application
working-directory: backend
run: npm run build --if-present
- name: Generate Prisma
working-directory: backend
run: npm run generate
- name: Run database migrations
working-directory: backend
run: npx prisma migrate deploy
env:
DATABASE_URL: mysql://prisma:prisma@localhost:3306/prisma
- name: Run tests
working-directory: backend
run: npm test