-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 962 Bytes
/
ci.yaml
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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{github.workflow}}-${{github.head_ref}}
cancel-in-progress: true
jobs:
build_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "lts/*"
cache: "npm"
- run: npm ci
- name: Build
if: github.event_name == 'pull_request' && github.event.action == 'opened'
env:
NEON_DATABASE_URL: ${{secrets.NEON_DATABASE_URL}}
run: npm run build
- name: Apply Prisma Migrations
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
NEON_DATABASE_URL: ${{secrets.NEON_DATABASE_URL}}
run: |
n=1
until n==6
do
npx prisma migrate deploy && break
n=$[$n+1]
sleep 3
done