-
Notifications
You must be signed in to change notification settings - Fork 9
44 lines (36 loc) · 1.14 KB
/
run-staging-migrations.yml
File metadata and controls
44 lines (36 loc) · 1.14 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
name: Run Staging Migrations
on:
workflow_dispatch:
permissions: {}
jobs:
migrate:
name: Run Database Migrations
runs-on: ubuntu-latest
timeout-minutes: 15
environment: staging
steps:
- name: Checkout repository
uses: actions/checkout@v6.0.1
- name: Set up Node.js
uses: actions/setup-node@v6.1.0
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
- name: Build database library
run: npx nx build database
- name: Run migrations
env:
PG_HOST: ${{ secrets.PG_HOST }}
PG_PORT: ${{ secrets.PG_PORT }}
PG_DATABASE: ${{ vars.DB_NAME }}
PG_USER: ${{ secrets.PG_USER }}
PG_PASSWORD: ${{ secrets.PG_PASSWORD }}
PG_SSL_CA: ${{ secrets.PG_SSL_CA }}
run: |
echo "🔄 Running database migrations..."
echo "Connecting to PostgreSQL at $PG_HOST:$PG_PORT"
echo "Database: $PG_DATABASE"
node dist/libs/database/src/scripts/run-migrations.js
echo "✅ Migrations completed successfully"