From 114f894e501f4d875cc1bb3aa747048662e1469c Mon Sep 17 00:00:00 2001 From: Roman Lutz Date: Fri, 13 Mar 2026 16:05:19 -0700 Subject: [PATCH 1/2] Fix GitHub Pages 404: use static HTML output for deployment JB2's default 'jupyter-book build' produces a SPA (JSON content + client-side rendering) that requires a web server. GitHub Pages serves static files and gets a 404 because there's no index.html. Fix by adding --html flag which generates static HTML via server-side rendering, and update the artifact upload path from _build/site to _build/html. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/docs.yml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 32a7faa7b1..cd5dabe5af 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -59,7 +59,7 @@ jobs: - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - path: "doc/_build/site" + path: "doc/_build/html" - name: Deploy to GitHub Pages if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} id: deployment diff --git a/Makefile b/Makefile index c512780cd1..852bb9fc0b 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ mypy: docs-build: uv run python build_scripts/pydoc2json.py pyrit --submodules -o doc/_api/pyrit_all.json uv run python build_scripts/gen_api_md.py - cd doc && uv run jupyter-book build --all + cd doc && uv run jupyter-book build --all --html uv run ./build_scripts/generate_rss.py # Regenerate only the API reference pages (without building the full site) From 5f891095350252e008e549af1a3bf797eb65160e Mon Sep 17 00:00:00 2001 From: Roman Lutz Date: Fri, 13 Mar 2026 16:12:47 -0700 Subject: [PATCH 2/2] Fix GitHub Pages: static HTML + BASE_URL env var Two issues causing the 404 after JB2 upgrade: 1. JB2's default build produces a SPA (JSON + client-side JS) that needs a web server. GitHub Pages serves static files -> no index.html. Fix: add --html flag to jupyter-book build. 2. Site is at azure.github.io/PyRIT/ (subpath), but assets were referenced from root (/build/...). Fix: set BASE_URL env var in the workflow per MyST deployment docs. - Makefile: jupyter-book build --all -> --all --html - docs.yml: artifact path _build/site -> _build/html - docs.yml: add BASE_URL env var using repository name Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/docs.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index cd5dabe5af..bc2af1c01d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -22,6 +22,10 @@ concurrency: group: "pages" cancel-in-progress: false +env: + # BASE_URL determines the website path prefix, including CSS & JS assets + BASE_URL: /${{ github.event.repository.name }} + # This job installs dependencies, builds the book, and pushes it to `gh-pages` jobs: deploy-book: