-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (44 loc) · 1.65 KB
/
liquid.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Postgres DB CI/DI Pipeline
on:
pull_request:
branches:
- main
push:
branches:
- main
paths:
- 'liquibaseChangelog/*'
- '.github/workflows/liquid.yaml'
- '.github/workflows/add_data_map.sh'
jobs:
test-liquibase-action:
runs-on: ubuntu-latest
name: Test Liquibase Action
steps:
- uses: actions/checkout@v2
- name: Generate Data Map Diff
if: github.event_name == 'pull_request'
shell: bash
run: .github/workflows/add_data_map.sh $${{ secrets.CYRAL_REPO_NAME }}
env:
CYRAL_CONTROL_PLANE: ${{ secrets.CYRAL_CONTROL_PLANE_URL }}
CYRAL_CLIENT_ID: ${{ secrets.CYRAL_API_CLIENT_ID }}
CYRAL_CLIENT_SECRET: ${{ secrets.CYRAL_API_CLIENT_SECRET }}
- name: Update Cyral Datamap for Repository
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
shell: bash
run: .github/workflows/add_data_map.sh $${{ secrets.CYRAL_REPO_NAME }} apply_changes
env:
CYRAL_CONTROL_PLANE: ${{ secrets.CYRAL_CONTROL_PLANE_URL }}
CYRAL_CLIENT_ID: ${{ secrets.CYRAL_API_CLIENT_ID }}
CYRAL_CLIENT_SECRET: ${{ secrets.CYRAL_API_CLIENT_SECRET }}
- name: Update database with changes using liquidbase
uses: liquibase/liquibase-github-action@v2
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
operation: 'update'
classpath: 'liquibaseChangelog'
changeLogFile: 'changelog.sql'
username: ${{ secrets.LIQUID_PG_USER }}
password: ${{ secrets.LIQUID_PG_PASS }}
url: ${{ secrets.LIQUID_PG_URL }}