This repository was archived by the owner on Apr 19, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (66 loc) · 1.84 KB
/
migration.yml
File metadata and controls
70 lines (66 loc) · 1.84 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
61
62
63
64
65
66
67
68
69
70
name: migrate
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "24"
- name: Enable Corepack
run: corepack enable
- name: Cache
uses: actions/cache@v4
id: cache-files
with:
path: |
**/node_modules
key: ${{ runner.os }}-cache-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
if: ${{ steps.cache-files.outputs.cache-hit != 'true' }}
run: yarn install --mode=skip-build
- name: Generate Prisma Client
run: yarn prisma generate
migrate-for-production:
environment: production
if: github.ref_name == 'main'
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: "24"
- name: Enable Corepack
run: corepack enable
- name: Restore cache
uses: actions/cache/restore@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-cache-${{ hashFiles('**/yarn.lock') }}
- name: Create .env
shell: bash
run: |
printf "DATABASE_URL=\"%s\"\nDIRECT_URL=\"%s\"\n" \
"${{ secrets.DATABASE_URL_FOR_MIGRATION }}" \
"${{ secrets.DIRECT_URL }}" > .env
- name: Generate Prisma Client
run: yarn prisma generate
- name: Generate Schema
run: yarn schema:gen
- name: Migrate
uses: nick-fields/retry@v3
with:
command: yarn migrate-for-single
max_attempts: 5
timeout_minutes: 10
retry_on: error