Skip to content

Merge pull request #18 from KhaosResearch/feat/generate-docs #5

Merge pull request #18 from KhaosResearch/feat/generate-docs

Merge pull request #18 from KhaosResearch/feat/generate-docs #5

Workflow file for this run

name: Generate and deploy OpenAPI Docs
on:
push:
branches:
- master
jobs:
generate-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[dev]"
- name: Generate OpenAPI JSON
run: python scripts/openapi.py
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Generate HTML from OpenAPI JSON
run: npx @redocly/cli build-docs openapi.json
- name: Move generated HTML to docs directory
run: |
mkdir -p docs
mv redoc-static.html docs/index.html
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./docs
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1