Files
SpecterOps-Nemesis/.github/workflows/generate-api-docs.yml
Lee Chagolla-Christensen 445c45a71d fix docs
2026-01-14 17:32:09 -08:00

73 lines
1.7 KiB
YAML

name: Generate API Documentation
on:
push:
branches: [main]
paths:
- 'projects/web_api/**'
- '.github/workflows/generate-api-docs.yml'
- '.github/scripts/generate_api_docs.py'
workflow_dispatch: # For manual triggering
jobs:
generate-docs:
runs-on: ubuntu-22.04
permissions:
contents: write
pages: write
id-token: write
environment:
name: github-pages
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Setup Python 3.12
run: uv python install 3.12
- name: Install dependencies
run: |
cd projects/web_api
uv sync --frozen
- name: Generate API documentation
run: |
cd projects/web_api
uv run python ../../.github/scripts/generate_api_docs.py
- name: Commit documentation changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'docs: update API documentation [skip ci]'
file_pattern: 'docs/*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install mkdocs dependencies
run: |
uv venv
uv pip install -r docs/requirements.txt
- name: Build documentation
run: |
uv run mkdocs build
- name: Setup Github pages
uses: actions/configure-pages@v4
- name: Create Github pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: site
- name: Deploy documentation to Github pages
uses: actions/deploy-pages@v4