Skip to content

Commit e33fdc7

Browse files
committed
Update package.json to include README.md in files and add prebuild script; remove usage section from README.md
1 parent ab70972 commit e33fdc7

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

.github/workflows/docs.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,25 @@ jobs:
2525

2626
- name: Build project
2727
run: npm run build
28-
29-
- name: Generate documentation
30-
run: npm run docs
28+
29+
- name: Generate TypeDoc (Markdown)
30+
run: npm run docs:api
31+
32+
- name: Fetch OpenAPI spec
33+
run: curl -L https://api.tenantos.com/docs/openapi.yaml -o openapi.yaml
34+
35+
- name: Generate Redoc (OpenAPI HTML)
36+
run: |
37+
if [ -f openapi.yaml ]; then
38+
npm run docs:openapi || echo "Redoc generation failed; continuing"
39+
else
40+
echo "No openapi.yaml found; skipping Redoc"
41+
fi
3142
3243
- name: Deploy to GitHub Pages
3344
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
3445
uses: peaceiris/actions-gh-pages@v3
3546
with:
3647
github_token: ${{ secrets.GITHUB_TOKEN }}
37-
publish_dir: ./.github/docs
38-
destination_dir: docs
48+
publish_dir: ./docs
49+
destination_dir: .

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"test": "echo \"Error: no test specified\" && exit 1",
3838
"schema:gen": "npx openapi-typescript https://api.tenantos.com/docs/openapi.yaml -o src/schema.ts",
3939
"docs:api": "typedoc",
40-
"docs:openapi": "redoc-cli build openapi.yaml -o docs/openapi/index.html",
40+
"docs:openapi": "npx @redocly/cli build-docs openapi.yaml -o docs/openapi/index.html",
4141
"docs": "npm run docs:api && npm run docs:openapi",
4242
"docs:api:html": "typedoc --options typedoc.html.json"
4343
},

0 commit comments

Comments
 (0)