Skip to content

Merge pull request #15 from DMontgomery40/cleanup #23

Merge pull request #15 from DMontgomery40/cleanup

Merge pull request #15 from DMontgomery40/cleanup #23

name: Docs Autopilot (push)
on:
push:
branches: ["main", "develop"]
paths:
- "server/**"
- "web/**"
- "scripts/docs_ai/**"
- "data/models.json"
- "data/glossary.json"
- "docker-compose.yml"
- "pyproject.toml"
- "tribrid_config.json"
- "start.sh"
workflow_dispatch:
inputs:
base_ref:
description: "Base ref to diff against (default: previous push SHA)"
required: false
default: ""
permissions:
contents: write
jobs:
docs-autopilot:
if: github.actor != 'github-actions[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
pip install mkdocs==1.6.1 mkdocs-material==9.7.1 pymdown-extensions==10.7.1
pip install mike==2.1.0 mkdocs-git-revision-date-localized-plugin==1.2.6 mkdocs-minify-plugin==0.8.0
pip install mkdocs-glightbox
- name: Generate docs patch (apply)
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# OpenAI model used by scripts/docs_ai/generate_docs_from_diff.py (Responses API)
OPENAI_MODEL: gpt-5.2
run: |
BASE="${{ github.event.inputs.base_ref }}"
if [ -z "$BASE" ]; then
BASE="${{ github.event.before }}"
fi
if [ -z "$BASE" ] || [ "$BASE" = "0000000000000000000000000000000000000000" ]; then
BASE="origin/${{ github.ref_name }}"
fi
echo "Using base ref: $BASE"
python scripts/docs_ai/generate_docs_from_diff.py --base "$BASE" --llm openai --apply
- name: Build documentation
run: mkdocs build --strict
- name: Commit and push docs updates
run: |
if git diff --cached --quiet; then
echo "No docs changes to commit."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -m "docs(ai): autopilot update"
git push origin HEAD:${{ github.ref_name }}