From b722aafd76e560b097f682fc8b381c7c46064cd0 Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Tue, 26 Nov 2024 11:40:09 +0000 Subject: [PATCH] chore: fix docs building (#19) --- .github/workflows/docs.yml | 27 +++++++++++---------------- python/docs/build.sh | 5 ----- scripts/build_py_docs.sh | 9 +++++++++ 3 files changed, 20 insertions(+), 21 deletions(-) delete mode 100755 python/docs/build.sh create mode 100755 scripts/build_py_docs.sh diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d5be2e9..7b167a7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -18,38 +18,33 @@ concurrency: group: "pages" cancel-in-progress: true + +env: + UV_VERSION: "0.4.29" + jobs: build: - defaults: - run: - working-directory: python name: Build docs. runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python '3.10' - uses: actions/setup-python@v5 + - name: Set up uv + uses: astral-sh/setup-uv@v3 with: - python-version: '3.10' - cache: "pip" + version: ${{ env.UV_VERSION }} + enable-cache: true - name: Install Protoc uses: arduino/setup-protoc@v2 - - name: Install Tierkreis - run: pip install '.[typecheck,docs]' + - name: Build docs - run: | - cd docs - ./build.sh + run: uv run --group docs scripts/build_py_docs.sh - name: Upload artifact. uses: actions/upload-pages-artifact@v3 with: - path: ./docs/build/ + path: ./python/docs/build/ publish: name: Publish docs. - defaults: - run: - working-directory: python environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} diff --git a/python/docs/build.sh b/python/docs/build.sh deleted file mode 100755 index 930623b..0000000 --- a/python/docs/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -mkdir build - -touch build/.nojekyll # Disable jekyll to keep files starting with underscores - -sphinx-build -b html ./api-docs ./build/api-docs diff --git a/scripts/build_py_docs.sh b/scripts/build_py_docs.sh new file mode 100755 index 0000000..ad20fbe --- /dev/null +++ b/scripts/build_py_docs.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# run from root directory +export DOCS_DIR=$(pwd)/python/docs +mkdir -p $DOCS_DIR/build + +touch $DOCS_DIR/build/.nojekyll # Disable jekyll to keep files starting with underscores + +sphinx-build -b html $DOCS_DIR/api-docs $DOCS_DIR/build/api-docs