From 61d0fa42f1f09c80eededa395b71a8e8dcfaaf84 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Fri, 6 Dec 2024 20:26:36 -0500 Subject: [PATCH] Add a workflow to generate the docs --- .github/workflows/generate_docs.yaml | 47 ++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/generate_docs.yaml diff --git a/.github/workflows/generate_docs.yaml b/.github/workflows/generate_docs.yaml new file mode 100644 index 000000000..d25b461bf --- /dev/null +++ b/.github/workflows/generate_docs.yaml @@ -0,0 +1,47 @@ +name: Generate API Documentation + +on: + release: + types: [published] # Run on new release + workflow_dispatch: # Manual trigger + +jobs: + update-docs: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r docs/requirements.txt + pip install . + + - name: Generate API documentation + run: | + cd docs + python generate_docs.py + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + commit-message: 'docs: Update API documentation' + title: 'docs: Update API documentation' + body: | + Automated PR to update API documentation. + + - Generated using `generate_docs.py` + - Triggered by: ${{ github.event_name }} + branch: update-api-docs + delete-branch: true + labels: | + documentation