Skip to content

Commit

Permalink
[ADD] - github actions for flyway migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
tofiksa committed Mar 31, 2024
1 parent 1569724 commit e115f89
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions .github/workflows/migrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,16 @@ jobs:
migrate-database:
name: Run Flyway migrations
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: ${{ secrets.SUPABASE_PASS }}
POSTGRES_USER: ${{ secrets.SUPABASE_USER }}
POSTGRES_DB: ${{ secrets.SUPABASE_DB }}
env:
SUPABASE_HOST: ${{ secrets.SUPABASE_HOST }}
SUPABASE_PORT: ${{ secrets.SUPABASE_PORT }}
SUPABASE_USER: ${{ secrets.SUPABASE_USER }}
SUPABASE_DB: ${{ secrets.SUPABASE_DB }}
steps:
- uses: actions/checkout@v2
- uses: joshuaavalon/[email protected]
with:
url: ${{ secrets.SUPABASE_URL }}
user: ${{ secrets.SUPABASE_USER }}
password: ${{ secrets.SUPABASE_PASS }}
locations: filesystem:./src/main/resources/db.migration
- run: echo 'deploying to prod'
- run: >-
docker run --rm
--volume ${{ github.workspace }}/src/main/resources/db.migration:/flyway/sql:ro
flyway/flyway:10.10.0-alpine
-url="jdbc:postgresql://${{ secrets.SUPABASE_HOST }}:${{ secrets.SUPABASE_PORT }}/${{ secrets.SUPABASE_DB }}?sslmode=require&user="${{ secrets.SUPABASE_USER }}&password=${{ secrets.SUPABASE_PASS }}"
migrate

0 comments on commit e115f89

Please sign in to comment.