Skip to content

red-gate/setup-flyway

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

Repository files navigation

Setup Flyway

Flyway

Deploy database changes with confidence

Basic validation E2E Validation License checks CodeQL Analysis


The setup-flyway action installs the Redgate Flyway CLI into your GitHub Actions workflow, enabling automated database migrations, version control for your schema, and seamless CI/CD integration. Supports 50+ databases including PostgreSQL, MySQL, SQL Server, and Oracle.

Usage

  • version - The version of Flyway CLI to set up. Can specify latest, an exact version, or a semver version. Default: latest.
  • edition - Required. The Flyway edition to use. Must be one of community, teams, or enterprise.
  • i-agree-to-the-eula - Required. Set to true to confirm you consent to the Redgate EULA.
  • architecture - The hardware architecture version of the Flyway CLI. Can specify x64, arm64, or java. The Java version will require Java 17 or higher to be installed, preferably using actions/setup-java. Default: the architecture of the runner.
  • platform - The operating system version of the Flyway CLI. Can specify linux, linux-alpine, macos, or windows. This setting is ignored when java is selected for the architecture. Default: the platform of the runner.
  • email - A Redgate email to be used in conjunction with the token parameter to configure a personal access token (PAT). Used to authenticate Flyway to use either Teams or Enterprise.
  • token - A personal access token (PAT) to be used in conjunction with the email parameter. This is used to license Flyway to access Teams or Enterprise features.

Note

The Flyway CLI supports the windows-x64, linux-x64, macosx-arm64, macosx-x64, and linux-alpine-x64 platforms. For all other platforms, the Java version of the Flyway CLI should be used.

Basic Configuration

Typical setup

- uses: red-gate/setup-flyway@v3
  with:
    edition: community
    i-agree-to-the-eula: true

Java version

- uses: actions/setup-java@v4
  with:
    distribution: 'zulu' # See 'Supported distributions' for available options
    java-version: '21'
- uses: red-gate/setup-flyway@v3
  with:
    edition: community
    i-agree-to-the-eula: true
    architecture: 'java'

Authentication

- uses: red-gate/setup-flyway@v3
  with:
    edition: enterprise
    i-agree-to-the-eula: true
    email: ${{ secrets.FLYWAY_EMAIL }}
    token: ${{ secrets.FLYWAY_TOKEN }}

Supported version syntax

The version input supports an exact version or a version range using SemVer notation:

  • major versions: 9, 10, 11, 12
  • more specific versions: 10.11, 10.12.0, 10.13.x
  • the current version: latest

Enterprise Features

Authenticate with a Redgate personal access token to unlock powerful CLI capabilities for scaling database delivery:

  • Code analysis & policies — enforce best practices with a built-in policy library and custom rules via flyway check -code
  • Drift detection — identify uncontrolled database changes with flyway check -drift
  • Change reports — preview migration impact with flyway check -changes
  • Undo migrations — auto-generate and run rollback scripts to recover from failed deployments
  • State-based deployments — auto-generate migration scripts by comparing schemas
  • Secrets manager integration — connect to external secrets managers for secure credential handling

Learn more about Flyway editions →

License

The scripts and documentation in this project are released under the MIT License.

Contributions

Contributions are welcome! See Code of Conduct

Breaking Changes

See Breaking Changes for a list of breaking changes.

Security Policy

Find a security issue? Please review our Security Policy.

Support

For support, please see the Support Policy.

About

Set up your GitHub Actions workflow with Flyway

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 9