Skip to content

rollback_changes_targeted #28

rollback_changes_targeted

rollback_changes_targeted #28

# This is a basic workflow to help you get started with Actions
name: rollback_changes_targeted
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
workflow_dispatch:
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]
inputs:
author:
description: 'Author'
required: true
default: 'liquibase-docs'
id:
description: 'ID'
required: true
default: 'createView-example2'
path:
description: 'Path'
required: true
default: 'Changelogs/changelog.sql'
env:
LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LIQUIBASE_PRO_LICENSE_KEY }}
LIQUIBASE_COMMAND_URL: ${{ secrets.LIQUIBASE_COMMAND_URL }}
LIQUIBASE_COMMAND_USERNAME: ${{ secrets.LIQUIBASE_COMMAND_USERNAME }}
LIQUIBASE_COMMAND_PASSWORD: ${{ secrets.LIQUIBASE_COMMAND_PASSWORD }}
LIQUIBASE_COMMAND_CHANGELOG_FILE: ${{ secrets.LIQUIBASE_COMMAND_CHANGELOG_FILE }}
LIQUIBASE_REPORTS_ENABLED: "TRUE"
jobs:
Build_Job:
runs-on: ubuntu-latest
environment:
name: DEV
steps:
- uses: actions/checkout@v4
- name: Rolling back DEV
uses: docker://liquibase/liquibase
with:
args: rollbackOneChangeset --changeset-author=${{ github.event.inputs.author }} --changeset-id=${{ github.event.inputs.id }} --changeset-path=${{ github.event.inputs.path }} --force
###
### Gather logs
###
- name: Gather reports DEV
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: reports-DEV
path: |
**/*.html
- name: Checkin DEV rollback report
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "DEV rollback report"
git push
Test_Job:
needs: Build_Job
runs-on: ubuntu-latest
environment:
name: TEST
steps:
- uses: actions/checkout@v4
- name: Rolling back TEST
uses: docker://liquibase/liquibase
with:
args: rollbackOneChangeset --changeset-author=${{ github.event.inputs.author }} --changeset-id=${{ github.event.inputs.id }} --changeset-path=${{ github.event.inputs.path }} --force --reports-name="rollback-${{ github.event.inputs.id }}-DEV.html"
###
### Gather logs
###
- name: Gather reports TEST
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: reports-TEST
path: |
**/*.html
- name: Checkin TEST rollback report
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "TEST rollback report"
git push
Deploy_Prod_Job:
needs: Test_Job
runs-on: ubuntu-latest
environment:
name: PROD
steps:
- uses: actions/checkout@v4
- name: Rolling back PROD
uses: docker://liquibase/liquibase
with:
args: rollbackOneChangeset --changeset-author=${{ github.event.inputs.author }} --changeset-id=${{ github.event.inputs.id }} --changeset-path=${{ github.event.inputs.path }} --force
###
### Gather logs
###
- name: Gather reports PROD
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: reports-PROD
path: |
**/*.html
- name: Checkin PROD rollback report
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "PROD rollback report"
git push