-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (46 loc) · 1.41 KB
/
ci.yml
File metadata and controls
60 lines (46 loc) · 1.41 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: CI/CD pipeline
on: push
jobs:
backend:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
services:
postgres:
image: postgres
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: password123
POSTGRES_DB: testdb
ports:
- 5432:5432
env:
JWT_SECRET_KEY: 5OQ1ZE9FJiP0d3PKTnOT
DATABASE_URL: postgresql://test:password123@localhost:5432/testdb?schema=public
steps:
- name: Notify Trigger
run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event on branch ${{ github.ref }}."
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
- name: Cache Dependencies
uses: actions/cache@v2
id: backend-npm-cache
with:
path: "node_modules"
key: client-npm-${{ hashFiles('package.json') }}
- name: Install Dependencies
run: npm install
if: steps.backend-npm-cache.outputs.cache-hit != 'true'
- name: Run Linter
run: npm run lint
- name: Run Typecheck
run: npm run typecheck
- name: Execute Migrations
run: npx prisma migrate deploy
- name: Run Test
run: npm run test
- name: Display Job Status
run: echo "🍏 This job's status is ${{ job.status }}."