-
Notifications
You must be signed in to change notification settings - Fork 8
42 lines (40 loc) · 1.1 KB
/
on-release.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
name: Sync from staging to prod
on:
workflow_dispatch:
release:
types: [published]
jobs:
sync-branch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Merge staging -> prod
uses: devmasx/merge-branch@master
with:
type: now
from_branch: next
target_branch: prod
github_token: ${{ secrets.GITHUB_TOKEN }}
database-migration:
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Apply all pending migrations to the database
run: npx prisma migrate deploy
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
- name: Update the classroom data
run: pnpm run update-classroom-data
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}