-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: SchemaSpy shared workflow (#102)
- Loading branch information
1 parent
f83e917
commit d358366
Showing
2 changed files
with
77 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: .Schema-Spy | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
### Typical / recommended | ||
flyway_args: | ||
description: 'Flyway arguments' | ||
default: 'info migrate info' | ||
required: false | ||
type: string | ||
flyway_locations: | ||
description: 'Flyway migrations location' | ||
default: 'filesystem:./migrations' | ||
required: false | ||
type: string | ||
flyway_schema: | ||
description: 'Flyway default schema' | ||
default: 'users' | ||
required: false | ||
type: string | ||
schemaspy_schema: | ||
description: 'SchemaSpy default schema' | ||
default: 'users' | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
schemaspy: | ||
name: Generate Documentation | ||
runs-on: ubuntu-24.04 | ||
services: | ||
postgres: | ||
image: postgis/postgis:16-3.4 | ||
env: | ||
POSTGRES_DB: default | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: default | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Flyway | ||
uses: docker://flyway/flyway:10 | ||
env: | ||
FLYWAY_URL: jdbc:postgresql://postgres:5432/default | ||
FLYWAY_USER: postgres | ||
FLYWAY_PASSWORD: default | ||
FLYWAY_LOCATIONS: ${{ inputs.flyway_locations }} | ||
FLYWAY_DEFAULT_SCHEMA: ${{ inputs.flyway_schema }} | ||
with: | ||
args: ${{ inputs.flyway_args }} | ||
|
||
- name: Create Output Folder | ||
run: | | ||
mkdir -p output/schema | ||
chmod a+rwx -R output | ||
- name: Run Schemaspy | ||
run: docker run --network host -v "$PWD/output:/output" schemaspy/schemaspy:6.2.4 -t pgsql11 -db default -host 127.0.0.1 -port 5432 -u postgres -p default -schemas ${{ inputs.schemaspy_schema }} | ||
|
||
- name: Deploy to Pages | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: output |
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