From 97345f4de0a1a0ff74f3a18d756ae9a83378c970 Mon Sep 17 00:00:00 2001 From: Brooke Hamilton <45323234+brooke-hamilton@users.noreply.github.com> Date: Fri, 19 Jun 2026 15:14:52 -0400 Subject: [PATCH] Fix missing images on PR preview deployments PR-preview builds baked a guessed preview hostname into Hugo's baseURL, which the theme emits as . Azure serves previews from a region-qualified host, so the base-href host differed from the serving host and all relative asset URLs resolved cross-origin, getting blocked by Chrome (ERR_BLOCKED_BY_ORB) and rendering images blank. Build pull_request previews with a root-relative baseURL (-b /) so the emitted resolves against whatever host serves the page. Production builds (push to main) are untouched and keep the repo-configured baseURL. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Brooke Hamilton <45323234+brooke-hamilton@users.noreply.github.com> --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eb8b35d..b82f238 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,7 +25,6 @@ jobs: env: GOVER: "^1.17" HUGO_ENV: production - SWA_BASE: brave-pond-00b49761e steps: - name: Checkout website repo uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 @@ -41,9 +40,10 @@ jobs: - name: Build Hugo Site run: | if [ "${GITHUB_EVENT_NAME}" == 'pull_request' ]; then - STAGING_URL="https://${SWA_BASE}-${{github.event.number}}.3.azurestaticapps.net/" + hugo -b "/" + else + hugo fi - hugo ${STAGING_URL+-b "$STAGING_URL"} - name: Upload Hugo artifacts uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1