ci: validate site builds on pull requests - #475
Closed
Shayne Boyer (spboyer) wants to merge 1 commit into
Closed
Conversation
Adds a PR-time site build check so changes to site/**, site/package-lock.json, or the site workflow files are validated before merge, mirroring the existing web CI pattern. The workflow uses a paths-filter with a skip shim inside a single job named 'Build' so branch protection can require it without deadlocking non-site PRs. When no site files changed the job short-circuits after the filter step and still reports success. Closes #473 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a dedicated GitHub Actions workflow to validate that the Starlight documentation site under site/ can build during pull requests, preventing broken site changes from merging without a green PR signal.
Changes:
- Adds a new
Site Buildworkflow that runs onpull_requestandpushformain/develop. - Uses
dorny/paths-filterto skip the site build steps on PRs that don’t touch site-related paths while still reporting a successful required check. - Mirrors the existing Pages workflow’s Node/npm setup (
node 22.12.0,npm ci,npm run build, npm cache keyed bysite/package-lock.json).
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/site-ci.yml | New PR-time docs-site build validation workflow with path-based skipping to keep required checks non-blocking. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Low
Comment on lines
+31
to
+51
| - name: Skip (no site changes) | ||
| if: steps.filter.outputs.site != 'true' && github.event_name == 'pull_request' | ||
| run: echo "No site/** changes detected — skipping site build." | ||
|
|
||
| - name: Setup Node | ||
| if: steps.filter.outputs.site == 'true' || github.event_name != 'pull_request' | ||
| uses: actions/setup-node@v7 | ||
| with: | ||
| node-version: '22.12.0' | ||
| cache: npm | ||
| cache-dependency-path: site/package-lock.json | ||
|
|
||
| - name: Install dependencies | ||
| if: steps.filter.outputs.site == 'true' || github.event_name != 'pull_request' | ||
| working-directory: site | ||
| run: npm ci | ||
|
|
||
| - name: Build site | ||
| if: steps.filter.outputs.site == 'true' || github.event_name != 'pull_request' | ||
| working-directory: site | ||
| run: npm run build |
Member
Author
|
Superseded by #476. Closing duplicate candidate from parallel coding-agent fanout. |
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.
Closes #473
Summary
Adds a PR-time build check for the Starlight docs site under
site/**so broken changes cannot merge with all required checks green (as happened in #446 / #462 / #468, where the Pages build only ran onpushtomain).Approach
New workflow
.github/workflows/site-ci.yml:pushtomain/developand on everypull_requesttargeting those branches — no top-levelpathsfilter, so the check always reports.dorny/paths-filterinside the job to detect whether the PR touches:site/**(source +site/package-lock.json).github/workflows/site-ci.yml.github/workflows/pages.ymlBuild:pushevents → runscd site && npm ci && npm run buildwith Node 22.12.0 and npm cache keyed onsite/package-lock.json(mirrors the existing Pages workflow).Why this pattern
Build) and always reports success, so branch protection can require it without deadlocking non-site PRs.npm ci+ build cost on PRs that actually touch site files, matching the request in the issue./webvalidation. Same Node 22 +npm ci && npm run buildshape as the web build ingo-ci.yml, adjusted for the site's Node version pin.Acceptance criteria
site/**,site/package-lock.json, or site workflow/config files validate the docs site before merge.Follow-ups (not in this PR)
Buildjob to the required checks list in branch protection settings.