Skip to content

Commit

Permalink
Merge pull request #18 from KhaosResearch/feat/generate-docs
Browse files Browse the repository at this point in the history
CD pipeline to generate API documentation
  • Loading branch information
benhid authored Jun 19, 2024
2 parents 7a4393e + 0570332 commit 3312d0c
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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

0 comments on commit 3312d0c

Please sign in to comment.