feat(docs): add Sphinx + GitHub Pages deploy workflow#10
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #8
Adds parity with the JS and Rust pipeline templates so repositories bootstrapped from this template can publish API docs to <org>.github.io/<repo>/ without re-inventing the workflow. - docs/: Sphinx scaffold using Furo, autodoc/autosummary, Napoleon (Google-style docstrings), and MyST for Markdown sources. - docs/requirements.txt + [project.optional-dependencies] docs: one-command install via `pip install -e ".[docs]"`. - .github/workflows/docs.yml: builds on every push and PR that touches docs/, src/, pyproject.toml, or the workflow itself; deploys to GitHub Pages only on push to main (mirrors PR #170 in link-foundation/relative-meta-logic so the published site is not gated on releases). - README.md "API Documentation" section documents the one-time Settings -> Pages -> Source = GitHub Actions toggle that cannot be automated. Closes #8
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $2.657466📊 Context and tokens usage:
Total: (5.4K new + 78.0K cache writes + 3.3M cache reads) input tokens, 19.5K output tokens, $2.657466 cost 🤖 Models used:
📎 Log file uploaded as Gist (1396KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart triggered (iteration 1)Reason: CI failures detected Starting new session to address the issues. Auto-restart-until-mergeable mode is active. This run will stop after 5 restart iterations. |
Working session summaryAll checks now pass on PR #10. The Build Package failure was a transient Final status on #10:
This summary was automatically extracted from the AI working session output. |
🔄 Auto-restart-until-mergeable Log (iteration 1)This log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $0.672120📊 Context and tokens usage:
Total: (20 new + 58.0K cache writes + 463.8K cache reads) input tokens, 3.1K output tokens, $0.672120 cost 🤖 Models used:
📎 Log file uploaded as Gist (3809KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
🎉 Auto-mergedThis pull request has been automatically merged by hive-mind.
Auto-merged by hive-mind with --auto-merge flag |
Closes #8.
Summary
Adds the same Sphinx-based GitHub Pages deploy pattern used by the JS and Rust pipeline templates, so repositories bootstrapped from this template can publish API documentation to
<org>.github.io/<repo>/without designing the workflow from scratch. Deploy is gated onpushtomain(notrelease: published), which is the canonical fix from link-foundation/relative-meta-logic#170.What changed
.github/workflows/docs.yml— new workflow.push,pull_request, andworkflow_dispatchthat touchesdocs/**,src/**,pyproject.toml, or the workflow itself.github.event_name == 'push' && github.ref == 'refs/heads/main'. PRs and forks build but do not deploy, so docs breakage is caught pre-merge without leaking write permissions.concurrency.cancel-in-progressisfalseonmain(matches the JS template) so a deploy never gets cancelled half-way.sphinx-build -W --keep-goingso warnings fail the build.docs/— minimal Sphinx scaffold.conf.py— Furo theme,sphinx.ext.autodoc+autosummary(recursive),napoleon(Google-style, matchesCONTRIBUTING.md),myst_parserfor Markdown, andintersphinxto CPython. Insertssrc/intosys.pathso autodoc findsmy_packagewithout an install in some local setups.index.md,api.md— landing page and autosummary-generated API reference.requirements.txt— pinned floor versions; mirrored under[project.optional-dependencies] docsinpyproject.tomlforpip install -e ".[docs]".pyproject.toml— newdocsoptional-dependency group..gitignore— ignore_site/anddocs/_autosummary/(the latter is regenerated on every build).README.md— new API Documentation section covering local preview and the one-timeSettings → Pages → Source = GitHub Actionstoggle (cannot be automated; explains the failure mode if skipped).CONTRIBUTING.md— note to build docs locally when changing public APIs/docstrings.changelog.d/— scriv fragment for the release notes.How this prevents the bug from #8
The Sphinx playground-style 404 in
relative-meta-logic#163happened because the deploy was gated onif: github.event_name == 'release', so pushing tomainnever published a site. This workflow ships the correct gate (pushtomain+workflow_dispatch) from day one.Test plan
pip install -e ".[docs]" && sphinx-build -W --keep-going -b html docs _site— builds cleanly, no warnings.ruff check .,ruff format --check .,mypy src,pytest tests/ -v— all pass.python -c "import yaml; yaml.safe_load(open('.github/workflows/docs.yml'))"— workflow YAML is valid.mainand confirm Pages deploys tohttps://link-foundation.github.io/python-ai-driven-development-pipeline-template/after the one-timeSettings → Pages → Source = GitHub Actionstoggle.Notes for downstream users
After bootstrapping a new repository from this template, update in
docs/conf.py:project,authordocs/api.md(currentlymy_package)Then flip
Settings → Pages → Source = GitHub Actionsonce. The next push tomainpublishes the docs.