From 25f5210f265cbaf7126b3edfd698a1700bd63e86 Mon Sep 17 00:00:00 2001 From: goodboy Date: Thu, 11 Jun 2026 15:18:02 -0400 Subject: [PATCH] Add gh-pages docs deploy workflow `docs.yml`: sphinx build on PRs + main pushes (via `uv sync --no-dev --group docs`), deploying to gh-pages only from main pushes using the official `actions/{upload-pages-artifact,deploy-pages}` pair - the `msgspec`-style flow wished for in #123. No `d2` bin in CI (yet) so the committed SVGs serve as-is. (this patch was generated in some part by [`claude-code`][claude-code-gh]) [claude-code-gh]: https://github.com/anthropics/claude-code --- .github/workflows/docs.yml | 62 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..f0b0d90a --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,62 @@ +name: docs + +# build sphinx docs on every PR + push to main; +# deploy to gh-pages only from main pushes. +# (see goodboy/tractor#123 for the original ask) +on: + push: + branches: + - main + pull_request: + # to run workflow manually from the "Actions" tab + workflow_dispatch: + +# needed by actions/deploy-pages +permissions: + contents: read + pages: write + id-token: write + +# never run >1 pages deploy at once +concurrency: + group: 'pages' + cancel-in-progress: true + +jobs: + build: + name: 'sphinx build' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install latest uv + uses: astral-sh/setup-uv@v6 + + # NOTE, no `d2` bin is installed in CI (yet) so + # the pre-rendered + committed SVGs under + # `docs/_diagrams/` are used as-is; see + # `docs/_ext/d2diagrams.py` for the fallback + # policy. + - name: Build html docs + run: | + uv sync --no-dev --group docs + uv run --no-dev --group docs make -C docs html + + - name: Upload pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs/_build/html + + deploy: + name: 'deploy to gh-pages' + if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy + id: deployment + uses: actions/deploy-pages@v4