Merge pull request #1750 from bcgov/hotfix/ALCS-2022-2 #481
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate Schemaspy Docs | |
on: | |
push: | |
branches: | |
- main | |
env: | |
NODE_ENV: test | |
jobs: | |
generate_schemaspy: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_USER: postgres | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@master | |
- uses: actions/setup-node@master | |
with: | |
node-version: 18 | |
- run: | | |
sudo apt-get install --yes --no-install-recommends postgresql-client | |
- run: | | |
export PGPASSWORD='postgres'; | |
psql -h 127.0.0.1 -U postgres -c 'CREATE SCHEMA IF NOT EXISTS alcs;' | |
- name: Setup Database | |
run: | | |
npm install | |
npm run alcs:migration:run | |
working-directory: services | |
- name: Import OATS | |
run: | | |
export PGPASSWORD='postgres'; | |
psql -h 127.0.0.1 -p 5432 -U postgres -f ora2pg/data/oats_prod_schema_ddl_18_2.sql | |
- name: Create Output Folder | |
run: | | |
mkdir output | |
chmod a+rwx -R output | |
- name: Run Schemaspy | |
run: docker run --network host -v "$PWD/output:/output" schemaspy/schemaspy:snapshot -t pgsql -db postgres -host 127.0.0.1 -port 5432 -u postgres -p postgres -schemas alcs,oats | |
- name: Deploy to Pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: output | |
target-folder: schemaspy |