Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,23 @@ jobs:
- name: Synchronize the locked environment
run: uv sync --locked

# Build exactly as validation does. BASE_URL makes generated links correct
# if the Pages location ever changes from the root URL.
# This repository is a user site served at the domain root. Do not set
# BASE_URL to "/": MyST adds its own separator, and that value produces
# broken protocol-relative asset paths such as //build/app.js.
- name: Build the production website
env:
BASE_URL: ${{ steps.pages.outputs.base_path || '/' }}
run: uv run --locked jupyter book build --html --strict

# A successful renderer exit is not enough if its asset URLs are invalid.
# Reject the exact regression observed during the first deployment.
- name: Check generated asset paths
shell: bash
run: |
test -f _build/html/index.html
if grep -RIlE '(src|href)="//build/' _build/html; then
echo "::error::Generated HTML contains broken //build/ asset URLs."
exit 1
fi

# This special Pages artifact is temporary deployment input. It is not
# committed to gh-pages and contains only the generated static website.
- name: Package the generated website for Pages
Expand Down
9 changes: 5 additions & 4 deletions PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,11 @@ permissions to the validation workflow.
- Remove the legacy configuration backups only after the production site has
been stable and the rollback procedure is documented.

**Progress:** the manually triggered workflow is prepared on the
`pages-deployment` branch. It must pass pull-request validation, be merged,
and then be enabled and exercised deliberately through the GitHub Pages
settings and Actions interface.
**Progress:** the manual workflow was merged and its first run completed, but
visual review caught malformed `//build/` asset URLs caused by setting the
root `BASE_URL` to `/`. The `fix-pages-base-url` branch removes that
override and adds a regression check. A corrected deployment and visual
verification remain required.

**Milestone exit criterion:** the Jupyter Book 2 site is live, important routes
are verified, deployment is reproducible, and a failed build cannot replace the
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ Run the non-interactive validation check before committing:

The script synchronizes the locked environment, removes any previous `_build`
output, and performs a clean Jupyter Book 2 build with strict validation. It
deletes the generated site when the check finishes, including after a failure.
also rejects invalid root asset URLs and deletes the generated site when the
check finishes, including after a failure.

## Build and preview locally

Expand Down
10 changes: 10 additions & 0 deletions scripts/check.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ try {
throw "The build completed without creating $indexPath"
}

$invalidAssetMatch = Get-ChildItem -LiteralPath (Join-Path $buildPath 'html') -Recurse -File -Filter '*.html' |
ForEach-Object {
Select-String -LiteralPath $_.FullName -Pattern '(?:src|href)="//build/' |
Select-Object -First 1
} |
Select-Object -First 1
if ($null -ne $invalidAssetMatch) {
throw "Generated HTML contains a broken //build/ asset URL"
}

Write-Host 'Validation passed: the strict build completed successfully.'
}
finally {
Expand Down
Loading