forked from Shikhar-Shetty/ProjectStack
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (37 loc) · 1.2 KB
/
ci.yml
File metadata and controls
48 lines (37 loc) · 1.2 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
name: Next.js + Prisma CI/CD
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-and-deploy:
runs-on: ${{ matrix.os }}
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest,macos-latest]
node-version: [22]
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix['node-version'] }}
- name: Cache node_modules
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{runner.os}}-node-${{ hashFiles('**/package-lock.json')}}
restore-keys: |
${{runner.os}}-node-
- name: Install Dependencies
run: npm ci
- name: Generate Prisma client
run: npx prisma generate
- name: Run migrations (optional)
run: npx prisma migrate deploy
- name: Run ESLint
run: npm run lint