From cbe293d50833a69ccd166fd2b4d6676f2f7b670b Mon Sep 17 00:00:00 2001 From: Jeremy Dyer Date: Wed, 19 Feb 2025 14:45:41 -0500 Subject: [PATCH] Docs CI build changes (#462) --- .github/workflows/build-docs.yml | 44 ++++++++++++++++++++++---------- docs/requirements.txt | 1 + docs/sphinx_docs/Makefile | 2 ++ docs/sphinx_docs/source/conf.py | 1 + 4 files changed, 35 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 29f276ef..beade1cd 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -11,37 +11,55 @@ on: branches: - main +permissions: + contents: read + pages: write + id-token: write + jobs: build: runs-on: linux-large-disk container: - image: ubuntu:latest + image: python:3.11-slim steps: - name: Checkout code uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Install system deps run: | - pip install --upgrade pip - apt-get update && apt-get install -y make + apt-get update && apt-get install -y make git # Install dependencies from docs/requirements.txt - name: Install mkdocs dependencies run: | pip install -r docs/requirements.txt - - name: Build Sphinx API Docs - run: | - cd docs/sphinx_docs - make html - cd ../../ - mv docs/sphinx_docs/build/html docs/docs/user-guide/api_docs + # - name: Build Sphinx API Docs + # run: | + # cd docs/sphinx_docs + # make html + # cd ../../ + # mv docs/sphinx_docs/build/html docs/docs/user-guide/api_docs - name: Build MkDocs Site run: mkdocs build --config-file docs/mkdocs.yml - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v4 + - name: Upload Site Artifacts + uses: actions/upload-pages-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./site + path: ./docs/site + + deploy: + needs: + - build + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/docs/requirements.txt b/docs/requirements.txt index 6ab28a29..30460298 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -9,4 +9,5 @@ mkdocs-include-dir-to-nav mkdocs-literate-nav mkdocs-site-urls sphinx +sphinx-markdown-builder sphinx-rtd-theme diff --git a/docs/sphinx_docs/Makefile b/docs/sphinx_docs/Makefile index d0c3cbf1..cb4c04f4 100644 --- a/docs/sphinx_docs/Makefile +++ b/docs/sphinx_docs/Makefile @@ -17,4 +17,6 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile + pwd + ls -l @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/sphinx_docs/source/conf.py b/docs/sphinx_docs/source/conf.py index adcbdc25..9f1799cb 100644 --- a/docs/sphinx_docs/source/conf.py +++ b/docs/sphinx_docs/source/conf.py @@ -6,6 +6,7 @@ import sys sys.path.insert(0, os.path.abspath("../../../api/src")) # nv-ingest-api src +print(f"!!!!!sys.path: {sys.path}") project = "nv-ingest" copyright = "2025, Nvidia"