-
Notifications
You must be signed in to change notification settings - Fork 2
36 lines (33 loc) · 967 Bytes
/
Copy pathdatabase-migration.yml
File metadata and controls
36 lines (33 loc) · 967 Bytes
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
name: Database migration
permissions:
contents: read
on:
pull_request:
branches:
- master
paths:
- 'common/database/migrations/**'
- .github/workflows/database-migration.yml
push:
branches:
- master
paths:
- 'common/database/migrations/**'
- .github/workflows/database-migration.yml
jobs:
migration:
runs-on: ubuntu-24.04
environment: ${{ github.event_name == 'push' && 'production' || 'staging' }}
steps:
- uses: Perdolique/automations/.github/actions/setup-pnpm@v3
with:
install-dependencies: 'true'
- name: Run database migration
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: pnpm --filter @pepega/database run db:migrate
- name: Seed staging database
if: github.event_name == 'pull_request'
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: pnpm --filter @pepega/database run db:seed