-
Notifications
You must be signed in to change notification settings - Fork 2
34 lines (33 loc) · 991 Bytes
/
dbdocs.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
name: Publish dbdocs
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install DBML CLI and dbdocs
run: sudo npm install -g @dbml/cli dbdocs
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install local pkg
run: pip install .[vendors]
- name: Generate SQL schema
run: sc-crawler schema mysql > schema.sql
- name: Convert SQL schema to DBML
run: sql2dbml --mysql schema.sql -o schema.dbml
- name: Add project description
run: cat project.dbml >> schema.dbml
- name: Update dbdocs project
env:
DBDOCS_TOKEN: ${{ secrets.DBDOCS_TOKEN }}
run: dbdocs build ./schema.dbml --project sc-crawler
- name: Archive SQL and DBML schemas
uses: actions/upload-artifact@v4
with:
name: schemas
path: schema.*