-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (35 loc) · 945 Bytes
/
db-migration.yaml
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: DB Migration
on:
push:
branches: [ main ]
paths:
- db/**
pull_request:
branches: [ main ]
paths:
- db/**
workflow_dispatch:
jobs:
validate-migrations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Test flyway migration scripts'
working-directory: ./db
run: |
./run_migrations_test.sh
apply-migrations:
runs-on: ubuntu-latest
environment: production
if: github.ref == 'refs/heads/main'
needs: validate-migrations
steps:
- uses: actions/checkout@v4
- name: Run migration
uses: docker://flyway/flyway:10-alpine
env:
FLYWAY_URL: ${{ secrets.DB_JDBC_URL }}
FLYWAY_USER: ${{ secrets.DB_FLYWAY_USER }}
FLYWAY_PASSWORD: ${{ secrets.DB_FLYWAY_PASSWORD }}
FLYWAY_LOCATIONS: filesystem:./db/migrations
FLYWAY_VALIDATE_MIGRATION_NAMING: true