2023-06-22 19:43:57 +00:00
|
|
|
name: prisma-migrate
|
2023-06-22 18:11:49 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
install:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: https://github.com/actions/checkout@v2
|
|
|
|
- name: Setup Nodejs
|
|
|
|
uses: https://github.com/actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: 16.x
|
|
|
|
cache: "yarn"
|
|
|
|
|
|
|
|
- name: Install
|
|
|
|
run: yarn install
|
|
|
|
- name: Rerun Install
|
|
|
|
run: yarn install
|
|
|
|
|
|
|
|
generate:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
needs: install
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: https://github.com/actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Setup Nodejs
|
|
|
|
uses: https://github.com/actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: 16.x
|
|
|
|
cache: "yarn"
|
|
|
|
|
|
|
|
- name: Install
|
|
|
|
run: yarn install
|
|
|
|
|
|
|
|
- run: rm -rf node_modules/.prisma
|
|
|
|
|
|
|
|
- name: Generate Prisma Client
|
|
|
|
run: npx prisma generate
|
|
|
|
|
|
|
|
migrate:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
needs: install
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: https://github.com/actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Setup Nodejs
|
|
|
|
uses: https://github.com/actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: 16.x
|
|
|
|
cache: "yarn"
|
|
|
|
|
|
|
|
- name: Install
|
|
|
|
run: yarn install
|
|
|
|
|
|
|
|
- run: rm -rf node_modules/.prisma
|
|
|
|
|
|
|
|
- name: Deploy Migrations
|
|
|
|
run: npx prisma migrate deploy
|
|
|
|
env:
|
|
|
|
DATABASE_URL: ${{ secrets.PROD_DATABASE_URL }}
|