This section explains setting up a GitHub Actions pipeline leveraging a self-hosted agent to execute Liquibase operations through Liquibase Flow files.
An integration with GitHub Actions requires the following:
A GitHub account with permission to administer the repository you created in your GitHub organization.
Liquibase Pro is installed on a self-hosted GitHub Actions runner. The network must be configured from this runner to allow connections to the databases you wish to manage.
For additional information on setting up GitHub Actions, visit the GitHub Actions documentation website.
Set up your environments in GitHub using the instructions from the Secure Setup Using GitHub Actions Secrets page in this guide.
The example uses DEV, QA, AND PROD environments.
There are four Github Actions provided in the example repository, each of which will execute under certain conditions:
Liquibase Pro CI Workflow - Executes whenever a pull request is opened against the 'develop' branch. When this workflow executes, it runs the pre-merge Custom Policy Checks via Liquibase Flow.
Liquibase Pro CD Workflow - This workflow will execute whenever a push event occurs on the 'develop' branch. A push event can occur due to several changes, including merging a PR or bypassing rules and pushing directly to the branch as a repository administrator. When this workflow executes, it will deploy all pending changes, including any which have been previously rolled back.
Liquibase Pro Deployment Workflow - To perform ad hoc deployments, manually select and execute this workflow via your repository's Actions tab.
Liquibase Pro Rollback One Update Workflow - To roll back the previous deployment, execute this workflow via your repository's Actions tab.