EXP-2127: Add per-PR preview deployments via GitHub Pages - #1872
Merged
Conversation
Add a deploy-preview job to the PR workflow that publishes the built site to the gh-pages branch under pr-preview/pr-<number>/ using rossjrw/pr-preview-action, posts a sticky comment with the preview URL, and tears the preview down when the PR closes. BASE_URL in docusaurus.config.js becomes env-driven so preview builds can target the Pages subpath; production builds are unaffected (env var unset resolves to the current baseUrl of "/"). Fork PRs are skipped: they get neither secrets nor a writable GITHUB_TOKEN, and already cannot build due to ADO npm feed auth. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Raw JSX attributes bypass Docusaurus baseUrl handling, so absolute /img, /logos, and /oas paths broke on the PR preview (served from /codat-docs/pr-preview/pr-<n>/ rather than /): - MDXComponents/Img: apply useBaseUrl to src, fixing all raw <img> tags in MDX content centrally (51 across 28 files) - Api: apply useBaseUrl to the OAS spec URL, fixing all 21 API reference pages centrally (Stoplight fetched /oas/... from the domain root, so specs 404'd on the preview) - Cards, Products, ClientLibraries: withBaseUrl on card images and internal links - support page, BlogSidebar: raw <a href="/..."> swapped for Docusaurus Link Production output is unchanged: with baseUrl "/", withBaseUrl is a no-op (every path already starts with "/"), and external URLs and bundled assets pass through untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pmckinney-codat
enabled auto-merge
August 4, 2026 16:32
…h deploys Literal <img> JSX written inside Markdown/MDX content bypasses the MDXComponents mapping entirely (MDX v3 semantics), so the previous MDXImg fix never saw it. Add a rehype plugin that rewrites absolute img srcs at compile time, wired into the docs and blog pipelines; it no-ops in production where baseUrl is "/". Also make PageHeader (frontmatter banner_image/banner_icon) and Clients (client logo paths) baseUrl-aware, the remaining components that received absolute asset paths as props. A clean subpath build now has zero unprefixed /img and /logos srcs across the output (was 127). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Link check results: |
tom-binnington-codat
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds per-PR preview deployments so reviewers can browse the rendered site before it merges. Jira: EXP-2127 (under EXP-1595).
What this does
deploy-previewjob in the PR workflow: builds the site withBASE_URL=/codat-docs/pr-preview/pr-<number>and publishes it to thegh-pagesbranch viarossjrw/pr-preview-action, which posts a sticky comment on the PR with the preview URL and updates it on every push.closed; the build/link-check job skips that event).BASE_URLindocusaurus.config.jsis now env-driven. Production/integration builds are unaffected — with the env var unset it resolves to the currentbaseUrlof/.GITHUB_TOKEN).Setup status
gh-pagesbranch initialised (root.nojekyll+ placeholder index).gh-pagesat https://codatio.github.io/codat-docs/ (required a one-off org-policy change to allow public Pages creation).Notes / tradeoffs
gh-pagesbranch accumulates history (image-heavy build output); an occasional force-reset keeps it in check.gh-pages).🤖 Generated with Claude Code