From 6e7ca230d9195b8e0e62061d46e044e56f26f032 Mon Sep 17 00:00:00 2001 From: gphipps Date: Tue, 6 Aug 2024 15:16:21 -0700 Subject: [PATCH] Debugging again --- .github/workflows/docs.yaml | 13 +++++++++++-- docs/build.py | 14 +++++++------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 59af1642..735617ad 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -11,6 +11,8 @@ permissions: jobs: docs: runs-on: ubuntu-latest + environment: + name: github-pages permissions: pages: write id-token: write @@ -26,13 +28,20 @@ jobs: pip install sphinx - name: Generate API docs & Build sphinx documentation run: | - sphinx-build -M help docs docs-out + git fetch --tags + git checkout publish-docs + git pull + cd docs + echo "docs.py Calling build.py" + python build.py + echo "Done Calling build.py" + cd .. - name: Setup Pages uses: actions/configure-pages@v5 - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - path: './docs-out' + path: './docs/pages' - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 diff --git a/docs/build.py b/docs/build.py index a1396c33..0cca1b26 100644 --- a/docs/build.py +++ b/docs/build.py @@ -12,15 +12,15 @@ def build_doc(version: str) -> None: run("git checkout publish-docs -- conf.py") run("git checkout publish-docs -- meta.toml") - run("sphinx-build -M html ../docs ../_build") - run("ls ../_build") - run(f"mv ../_build/html ../pages/{version}") - run("rm -rf ../_build") + run("sphinx-build -M html . _build") + run("ls _build") + run(f"mv _build/html pages/{version}") + run("rm -rf _build") run("git checkout publish-docs") def build_init_page(version: str) -> None: - with open("../pages/index.html", "w") as f: + with open("pages/index.html", "w") as f: f.write(f""" """) @@ -29,8 +29,8 @@ def build_init_page(version: str) -> None: # Executes in the docs directory, hence the constant use of .. # create pages folder print("Python main") - run("rm -rf ../pages") - run("mkdir ../pages") + run("rm -rf pages") + run("mkdir pages") # get versions with open("meta.toml", "rb") as f: