Skip to content

Commit 9414bb2

Browse files
committed
chore(build): update CI to publish docs
1 parent 4ed04d9 commit 9414bb2

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

.github/workflows/docs.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
jobs:
10+
docs:
11+
name: Publish docs / OS ${{ matrix.os }} / Node ${{ matrix.node }}
12+
strategy:
13+
matrix:
14+
os:
15+
- ubuntu-latest
16+
node:
17+
- '12'
18+
19+
runs-on: ${{ matrix.os }}
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- uses: actions/setup-node@v2
25+
with:
26+
node-version: ${{ matrix.node }}
27+
28+
- run: |
29+
npm ci
30+
npm run docs:export
31+
32+
- name: Generate Swagger UI
33+
uses: Legion2/swagger-ui-action@v1
34+
with:
35+
output: docs
36+
spec-file: openapi.json
37+
38+
- name: Publish
39+
uses: peaceiris/actions-gh-pages@v3
40+
with:
41+
github_token: ${{ secrets.GITHUB_TOKEN }}
42+
publish_dir: docs
43+
force_orphan: true
44+
commit_message: 'docs: update'

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,6 @@ dist/
108108

109109
# Binaries
110110
bin/
111+
112+
# postgres-meta
113+
openapi.json

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"build:main": "tsc -p tsconfig.json && cpy 'src/lib/sql/*.sql' dist/main/sql",
2020
"build:module": "tsc -p tsconfig.module.json && cpy 'src/lib/sql/*.sql' dist/module/sql",
2121
"build:server": "tsc -p tsconfig.server.json && cpy 'src/lib/sql/*.sql' bin/src/lib/sql",
22+
"docs:export": "PG_META_EXPORT_DOCS=true ts-node-dev src/server/app.ts",
2223
"start": "ts-node-dev src/server/app.ts | pino-pretty --colorize",
2324
"dev": "run-s clean format start",
2425
"pkg": "run-s clean format build:server && pkg --out-path bin .pkg.config.json",

0 commit comments

Comments
 (0)