chore(deps): bump the lockfile-minor-patch group with 9 updates #97
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy API Docs | |
| # Build the Sphinx API docs inside the dev image (same slim-Python + uv | |
| # environment everything else uses — no conda) and publish to gh-pages. | |
| # autodoc imports shapepipe, so it needs the full runtime; the dev image's | |
| # `doc` extra provides sphinx + myst-parser + the theme on top of that. | |
| # | |
| # The published site is versioned. Each ref builds at its own time, in its own | |
| # image, into its own slice of the gh-pages branch: | |
| # master / main -> site root (stable; keeps existing URLs working) | |
| # develop -> /latest/ | |
| # tags v* -> /<tag>/ (e.g. /v1.1.0/) | |
| # A `switcher.json` at the site root drives the version dropdown. Pull requests | |
| # build the docs and upload them as an artifact, but do not deploy — so a broken | |
| # docs build is caught before merge, and reviewers can preview the rendered HTML. | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| - develop | |
| tags: | |
| - "v*" | |
| # On PRs, build + upload the docs (no deploy) only when something that affects | |
| # them changes, so a broken docs build is caught before merge. | |
| pull_request: | |
| paths: | |
| - "docs/**" | |
| - "src/**" | |
| - "pyproject.toml" | |
| - ".github/workflows/cd.yml" | |
| workflow_dispatch: | |
| jobs: | |
| api: | |
| name: Deploy API Documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - name: Resolve version slug | |
| id: slug | |
| # Map the pushed ref to a version label (DOCS_VERSION, used by conf.py to | |
| # highlight the switcher) and a gh-pages destination directory ("." = root). | |
| run: | | |
| case "${GITHUB_REF}" in | |
| refs/tags/*) slug="${GITHUB_REF#refs/tags/}"; dir="${slug}" ;; | |
| refs/heads/develop) slug="latest"; dir="latest" ;; | |
| refs/heads/master|refs/heads/main) slug="stable"; dir="." ;; | |
| *) slug="latest"; dir="latest" ;; | |
| esac | |
| echo "slug=$slug" >> "$GITHUB_OUTPUT" | |
| echo "dir=$dir" >> "$GITHUB_OUTPUT" | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0 | |
| with: | |
| driver-opts: network=host | |
| - name: Build dev image | |
| uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0 | |
| with: | |
| context: . | |
| target: dev | |
| load: true | |
| tags: shapepipe-dev:docs | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| # Generate API stubs and build the HTML inside the image. docs/ is | |
| # bind-mounted so sphinx-apidoc's generated rst and the _build output | |
| # land back on the runner for the deploy step. DOCS_VERSION tells conf.py | |
| # which version this build represents (for the switcher highlight). | |
| - name: Build API documentation | |
| run: | | |
| docker run --rm -e DOCS_VERSION="${{ steps.slug.outputs.slug }}" \ | |
| -v "${GITHUB_WORKSPACE}/docs:/app/docs" shapepipe-dev:docs bash -c " | |
| sphinx-apidoc -t docs/_templates -feTMo docs/source src/shapepipe src/shapepipe/modules/*_runner.py && | |
| sphinx-build -E docs/source docs/_build | |
| " | |
| - name: Upload built HTML as artifact | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: docs-html-${{ steps.slug.outputs.slug }} | |
| path: docs/_build | |
| # Stage the gh-pages payload: the build under its version directory, plus a | |
| # fresh switcher.json at the root so the dropdown stays current whenever any | |
| # version is published. | |
| - name: Stage versioned site | |
| if: github.event_name != 'pull_request' | |
| run: | | |
| target="site" | |
| [ "${{ steps.slug.outputs.dir }}" != "." ] && target="site/${{ steps.slug.outputs.dir }}" | |
| mkdir -p "$target" | |
| cp -r docs/_build/. "$target"/ | |
| cp docs/switcher.json site/switcher.json | |
| # keep_files: true so each deploy only writes its own version directory (and | |
| # the root switcher.json) and never wipes the other versions on the branch. | |
| - name: Deploy API documentation | |
| if: github.event_name != 'pull_request' | |
| uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: site | |
| keep_files: true |