Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

joshuaavalon/flyway-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flyway Action [Deprecated]

You can run the Docker image directly without using this action.

- uses: docker://flyway/flyway:9
  env:
    FLYWAY_URL: jdbc:postgresql://postgres:5432/db
    FLYWAY_USER: user
    FLYWAY_PASSWORD: password
    FLYWAY_LOCATIONS: filesystem:./sql
    FLYWAY_VALIDATE_MIGRATION_NAMING: true

This action runs Flyway v9 to migrate database. It aims to migrate database for testing in workflows.

Usage

name: Main
on:
  - push
jobs:
  test:
    runs-on: ubuntu-latest
    services:
      postgres:
        image: postgres
        env:
          POSTGRES_DB: db
          POSTGRES_USER: user
          POSTGRES_PASSWORD: password
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
    steps:
      - uses: actions/checkout@v2
      - uses: joshuaavalon/flyway-action@v3.0.0
        with:
          url: jdbc:postgresql://postgres:5432/db
          user: user
          password: password
      - run: echo 'testing'

Currently, it supports url, user, password, initSql and locations. locations are default to filesystem:./sql.

Extra configurations can be passed via environment variables.

- uses: joshuaavalon/flyway-action@v3.0.0
  with:
    url: jdbc:postgresql://postgres:5432/db
    user: user
    password: password
  env:
    FLYWAY_VALIDATE_MIGRATION_NAMING: true

For details, please check out Flyway documentation.