File tree Expand file tree Collapse file tree 3 files changed +1164
-0
lines changed
Expand file tree Collapse file tree 3 files changed +1164
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy API Docs to GitHub Pages
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ workflow_dispatch :
7+
8+ jobs :
9+ build-docs :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout code
13+ uses : actions/checkout@v4
14+
15+ - name : Set up Python
16+ uses : actions/setup-python@v5
17+ with :
18+ python-version : ' 3.12'
19+
20+ - name : Install Python dependencies (mínimas para OpenAPI)
21+ run : |
22+ pip install fastapi sqlmodel sqlalchemy aiosqlite
23+
24+ - name : Export OpenAPI schema
25+ env :
26+ SECRET_KEY : dummy
27+ ALGORITHM : HS256
28+ ACCESS_TOKEN_EXPIRE_MINUTES : 20
29+ SQLITE_PATH : /tmp/pynewsdb.db
30+ SQLITE_URL : sqlite+aiosqlite:////tmp/pynewsdb.db
31+ PYTHONPATH : .
32+ run : |
33+ python scripts/export_openapi.py app.main:app openapi.json
34+
35+ - name : Set up Node.js
36+ uses : actions/setup-node@v4
37+ with :
38+ node-version : ' 20'
39+
40+ - name : Generate static docs (Redoc)
41+ run : |
42+ npx --yes redoc-cli bundle openapi.json -o docs/index.html
43+
44+ - name : Deploy to GitHub Pages
45+ uses : peaceiris/actions-gh-pages@v4
46+ with :
47+ github_token : ${{ secrets.GITHUB_TOKEN }}
48+ publish_dir : ./docs
You can’t perform that action at this time.
0 commit comments