Skip to content

Commit 50bbdae

Browse files
authored
Create static.yml
1 parent 1c7b703 commit 50bbdae

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/static.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Generate Documentation
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
docs:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '18'
23+
cache: 'npm'
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Build project
29+
run: npm run build
30+
31+
- name: Generate TypeDoc (Markdown)
32+
run: npm run docs:api
33+
34+
- name: Fetch OpenAPI spec
35+
run: curl -L https://api.tenantos.com/docs/openapi.yaml -o openapi.yaml
36+
37+
- name: Generate Redoc (OpenAPI HTML)
38+
run: |
39+
if [ -f openapi.yaml ]; then
40+
npm run docs:openapi || echo "Redoc generation failed; continuing"
41+
else
42+
echo "No openapi.yaml found; skipping Redoc"
43+
fi
44+
45+
- name: Deploy to GitHub Pages
46+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
47+
uses: peaceiris/actions-gh-pages@v3
48+
with:
49+
github_token: ${{ secrets.GITHUB_TOKEN }}
50+
publish_dir: ./docs
51+
destination_dir: .

0 commit comments

Comments
 (0)