From 39a8c4a6606857ed51c1f579ff08e2755286baa6 Mon Sep 17 00:00:00 2001 From: Mike Turner Date: Fri, 11 Sep 2026 13:53:27 +0800 Subject: [PATCH 1/2] Add build-docs github action --- .github/workflows/build-docs.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/build-docs.yml diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml new file mode 100644 index 00000000..227002d4 --- /dev/null +++ b/.github/workflows/build-docs.yml @@ -0,0 +1,30 @@ +name: build-docs + +on: [push, pull_request, workflow_dispatch] + +permissions: + contents: write + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: Install dependencies + run: | + pip install sphinx sphinx_rtd_theme + - name: Generate API docs + run: | + sphinx-apidoc --force --implicit-namespaces --module-first --no-toc --separate -o docs/source/_reference src/echo + - name: Sphinx build + run: | + sphinx-build -b html docs/source docs/_build + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + with: + publish_branch: gh-pages + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: _build/ + force_orphan: true From 42231e49b4c2e3a9a5d16fe42ced163aa49a6556 Mon Sep 17 00:00:00 2001 From: Mike Turner Date: Fri, 11 Sep 2026 13:57:52 +0800 Subject: [PATCH 2/2] Small fixes --- .github/workflows/build-docs.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 227002d4..8240f743 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -1,10 +1,10 @@ name: build-docs - -on: [push, pull_request, workflow_dispatch] - +on: + push: + branches: + - main permissions: contents: write - jobs: docs: runs-on: ubuntu-latest @@ -22,9 +22,9 @@ jobs: sphinx-build -b html docs/source docs/_build - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + if: github.ref == 'refs/heads/main' with: publish_branch: gh-pages github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: _build/ + publish_dir: docs/_build/ force_orphan: true