Skip to content

ci: validate site builds on pull requests - #475

Closed
Shayne Boyer (spboyer) wants to merge 1 commit into
mainfrom
spboyer-ci-validate-site-on-pr
Closed

ci: validate site builds on pull requests#475
Shayne Boyer (spboyer) wants to merge 1 commit into
mainfrom
spboyer-ci-validate-site-on-pr

Conversation

@spboyer

Copy link
Copy Markdown
Member

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 on push to main).

Approach

New workflow .github/workflows/site-ci.yml:

  • Runs on push to main/develop and on every pull_request targeting those branches — no top-level paths filter, so the check always reports.
  • Uses dorny/paths-filter inside the job to detect whether the PR touches:
    • site/** (source + site/package-lock.json)
    • .github/workflows/site-ci.yml
    • .github/workflows/pages.yml
  • Single job named Build:
    • On PRs that don't touch those paths → skip shim step logs "No site/** changes detected" and the job passes.
    • On PRs that touch them, and on all push events → runs cd site && npm ci && npm run build with Node 22.12.0 and npm cache keyed on site/package-lock.json (mirrors the existing Pages workflow).

Why this pattern

  • Safe as a required check. The job name is stable (Build) and always reports success, so branch protection can require it without deadlocking non-site PRs.
  • Efficient. Only pays the npm ci + build cost on PRs that actually touch site files, matching the request in the issue.
  • Mirrors /web validation. Same Node 22 + npm ci && npm run build shape as the web build in go-ci.yml, adjusted for the site's Node version pin.

Acceptance criteria

  • PRs touching site/**, site/package-lock.json, or site workflow/config files validate the docs site before merge.
  • Non-site PRs still report a successful (skipped) site check.
  • Dependabot site PRs will now get the same signal before merge that Pages currently provides only after merge.

Follow-ups (not in this PR)

  • Consider adding the site Playwright e2e tests as an optional job.
  • If desired, add this workflow's Build job to the required checks list in branch protection settings.

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>
Copilot AI review requested due to automatic review settings July 28, 2026 13:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Build workflow that runs on pull_request and push for main/develop.
  • Uses dorny/paths-filter to 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 by site/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
@spboyer

Copy link
Copy Markdown
Member Author

Superseded by #476. Closing duplicate candidate from parallel coding-agent fanout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: validate site builds on pull requests

3 participants