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.
version- The version of Flyway CLI to set up. Can specifylatest, an exact version, or a semver version. Default:latest.edition- Required. The Flyway edition to use. Must be one ofcommunity,teams, orenterprise.i-agree-to-the-eula- Required. Set totrueto confirm you consent to the Redgate EULA.architecture- The hardware architecture version of the Flyway CLI. Can specifyx64,arm64, orjava. The Java version will require Java 17 or higher to be installed, preferably usingactions/setup-java. Default: the architecture of the runner.platform- The operating system version of the Flyway CLI. Can specifylinux,linux-alpine,macos, orwindows. This setting is ignored whenjavais selected for the architecture. Default: the platform of the runner.email- A Redgate email to be used in conjunction with thetokenparameter 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 theemailparameter. 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.
- uses: red-gate/setup-flyway@v3
with:
edition: community
i-agree-to-the-eula: true- 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'- uses: red-gate/setup-flyway@v3
with:
edition: enterprise
i-agree-to-the-eula: true
email: ${{ secrets.FLYWAY_EMAIL }}
token: ${{ secrets.FLYWAY_TOKEN }}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
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 →
The scripts and documentation in this project are released under the MIT License.
Contributions are welcome! See Code of Conduct
See Breaking Changes for a list of breaking changes.
Find a security issue? Please review our Security Policy.
For support, please see the Support Policy.