For PostgreSQL users - where are your DBs hosted?

Example GitHub Action Scripts

Migrate

The following example uses Flyway on Docker and migrates pending migrations to a target database whose connection information is stored as a secret. To access Flyway Teams or Flyway Enterprise features a personal access token and email address need to be provided. These should also be provided as secrets.

  1. name: 'Flyway Migrate'
  2.  
  3. on:
  4. push:
  5. branches:
  6. - main
  7.  
  8. jobs:
  9. deploy:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - name: Run Flyway Migrate
  13. uses: docker://redgate/flyway:11
  14. with:
  15. args: >-
  16. migrate
  17. -workingDirectory="/github/workspace/"
  18. -url="${{ secrets.FLYWAY_URL }}"
  19. -user="${{ secrets.FLYWAY_USER }}"
  20. -password="${{ secrets.FLYWAY_PASSWORD }}"
  21. env:
  22. FLYWAY_EMAIL: ${{ secrets.FLYWAY_EMAIL }}
  23.           FLYWAY_TOKEN: ${{ secrets.FLYWAY_TOKEN }}


Change and Drift Reports

The following example uses Flyway on Docker and generates a change and drift report.  Your target database connection information is stored as a secret and a build environment has been defined in the project's settings.  To access Flyway Teams or Flyway Enterprise features a personal access token and email address need to be provided. These should also be provided as secrets.

  1. name: 'Flyway Report'
  2.  
  3. on: pull_request
  4.  
  5. jobs:
  6. report:
  7. runs-on: ubuntu-latest
  8. steps:
  9. - name: Run Flyway Report
  10. uses: docker://redgate/flyway:11
  11. with:
  12. args: >-
  13. check -changes -drift
  14. -workingDirectory="/github/workspace/"
  15. -url="${{ secrets.FLYWAY_URL }}"
  16. -user="${{ secrets.FLYWAY_USER }}"
  17. -password="${{ secrets.FLYWAY_PASSWORD }}"
  18. -check.buildEnvironment="build"
  19. env:
  20.           FLYWAY_EMAIL: ${{ secrets.FLYWAY_EMAIL }}
  21.           FLYWAY_TOKEN: ${{ secrets.FLYWAY_TOKEN }}



Didn't find what you were looking for?