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.pull/6632/head^2
parent
e03e7874fc
commit
61a88db39b
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue