Skip to content

chore!: remove type from datamanager #466

chore!: remove type from datamanager

chore!: remove type from datamanager #466

Workflow file for this run

name: SQL Documentation
on:
pull_request:
branches:
- main
paths:
- 'server/standalone/migration/*.sql'
concurrency:
# Cancel previous workflows on branch push
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
database_diagram:
name: Database diagram
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
runs-on: ubuntu-latest
env:
GOLANG_MIGRATE_VERSION: v4.15.2
TBLS_VERSION: v1.64.0
ORCHESTRATOR_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres?sslmode=disable
TBLS_DIR: tbls_tmp
DB_DIAGRAM_PATH: docs/schemas/standalone-database.svg
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT_OWLFRED_DOC_GENERATION }}
- name: Install tools
run: |
BIN_DIR="$HOME/.local/bin"
mkdir -p "$BIN_DIR"
echo "$BIN_DIR" >> $GITHUB_PATH
wget -qO- https://github.com/golang-migrate/migrate/releases/download/${GOLANG_MIGRATE_VERSION}/migrate.linux-amd64.tar.gz | tar xzf - -C "$BIN_DIR"
wget -qO- https://github.com/k1LoW/tbls/releases/download/${TBLS_VERSION}/tbls_${TBLS_VERSION}_linux_amd64.tar.gz | tar xzf - -C "$BIN_DIR"
- name: Wait for database
run: |
while ! $(nc localhost 5432 -z); do
sleep 2
done
timeout-minutes: 1
- name: Migrate database
run: |
migrate -source file://./server/standalone/migration/ -database "$ORCHESTRATOR_DATABASE_URL" up
- name: Generate database diagram
run: |
tbls doc "$ORCHESTRATOR_DATABASE_URL" "$TBLS_DIR"
rm -f "$DB_DIAGRAM_PATH"
mv "$TBLS_DIR/schema.svg" "$DB_DIAGRAM_PATH"
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: docs/schemas/standalone-database.svg
commit_message: '[auto] generate database diagram'
commit_options: '--signoff'