From 61a88db39b03fadfa31142a3105f08d9c0797021 Mon Sep 17 00:00:00 2001 From: Jason Stirnaman Date: Fri, 19 Dec 2025 19:31:37 -0500 Subject: [PATCH] fix(ci): set baseURL for PR preview subdirectory deployment (#6658) * refactor(ci): improve PR preview with products.yml and index page - Load product prefixes from data/products.yml (single source of truth) - Build regex pattern dynamically from loaded namespaces - Fix CSS copying: Hugo outputs fingerprinted CSS at root level - Generate index.html with clickable links to preview pages - Add test for influxdb3_explorer namespace This keeps the URL parser in sync as new products are added and provides a better preview experience with navigable links. * fix(ci): set baseURL for preview subdirectory deployment Hugo generates absolute paths for fingerprinted assets based on baseURL. When deploying to GitHub Pages subdirectory (pr-preview/pr-XXXX/), assets were incorrectly resolving to the root instead of the preview path. This sets --baseURL to the correct preview URL so all asset paths work. --- .github/workflows/pr-preview.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index cbbd9e5e1..17516f7a4 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -85,9 +85,12 @@ jobs: - name: Build Hugo site if: steps.detect.outputs.pages-to-deploy != '[]' id: build + env: + # Set baseURL for GitHub Pages preview subdirectory + PREVIEW_BASE_URL: https://influxdata.github.io/docs-v2/pr-preview/pr-${{ github.event.number }}/ run: | START_TIME=$(date +%s) - npx hugo --minify + npx hugo --minify --baseURL "$PREVIEW_BASE_URL" END_TIME=$(date +%s) DURATION=$((END_TIME - START_TIME)) echo "build-time=${DURATION}s" >> $GITHUB_OUTPUT