-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (32 loc) · 1.23 KB
/
dbdocs.yml
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
name: Generate DB Docs
on:
push:
branches: [main]
# You could test this CI job in a PR by uncommenting the below pull_request line.
# pull_request:
# branches: [develop]
jobs:
generate-docs:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.x"
- name: Install dependencies
run: npm ci
- name: Install dbdocs
run: sudo npm install -g dbdocs
- name: Check dbdocs
run: dbdocs
- name: Install DB Generator for Prisma
run: npm install prisma-dbml-generator@0.10.0-dev.1
- name: add generator to Prisma's schema
run: printf '\ngenerator dbml {\n provider = "prisma-dbml-generator"\n includeRelationFields = "false"\n}' >> ./database/schemas/core/schema.prisma
- name: Generate DB Docs schema file
run: npx prisma generate --schema ./database/schemas/core/schema.prisma
- name: Upload DB Docs schema file
env:
DBDOCS_TOKEN: ${{ secrets.DBDOCS_TOKEN }}
run: dbdocs build ./database/schemas/core/dbml/schema.dbml --password ${{ secrets.DBDOCS_PROJECT_PASSWORD }} --project "Pagoda Developer Console"