Skip to content

ci: add docs build check workflow on pull request#330

Merged
fslongjin merged 1 commit into
masterfrom
feature/docs-build-check
May 21, 2026
Merged

ci: add docs build check workflow on pull request#330
fslongjin merged 1 commit into
masterfrom
feature/docs-build-check

Conversation

@fslongjin
Copy link
Copy Markdown
Member

Summary

  • Add a new GitHub Actions workflow docs-build-check.yml to automatically verify VitePress builds on pull requests that modify files in the docs directory.
  • Configure Node 22 environment and caching of npm packages to optimize the build check speed.

Test plan

  • Manually verified that the workflow triggers on pull requests targeting docs/** and .github/workflows/docs-build-check.yml.
  • Verified VitePress configuration builds successfully using npm run docs:build locally.

Autonomously-by: CursorAgent:gemini-3.5-flash

Made with Cursor

A new GitHub Actions workflow has been created to build the documentation
whenever a pull request modifies any files in the docs directory.
This ensures that VitePress builds correctly before changes are merged.

Autonomously-by: CursorAgent:gemini-3.5-flash
Signed-off-by: jinlong <jinlong@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@cubesandboxbot
Copy link
Copy Markdown

cubesandboxbot Bot commented May 21, 2026

Claude finished @fslongjin's task in 1m 34s —— View job


Reviewing the Docs Build Check workflow

Summary

This PR adds a new GitHub Actions workflow (docs-build-check.yml) that automatically verifies VitePress documentation builds on PRs modifying files in the docs/ directory. Overall this is a well-structured, useful addition. Below are my findings.


✅ What's done well

  • Path triggering: The workflow correctly triggers on docs/** changes and its own workflow file, and not on unrelated changes.
  • Concurrency group: Uses the same pattern as the existing docs-bilingual-check.yml, cancelling in-progress runs to save CI resources.
  • Minimal permissions: Restricts to contents: read — follows the principle of least privilege.
  • npm ci usage: Uses npm ci instead of npm install, which is the correct choice for CI (ensures reproducible builds and is faster).
  • working-directory: docs: Properly scopes npm commands to the docs subdirectory.

🔍 Suggestions

1. Node version inconsistency between workflows (docs-build-check.yml:28, deploy-pages.yml:35)

The new workflow uses node-version: 22, while the existing deploy-pages.yml (which does the actual deployment) uses node-version: 20. If these produce different build output (e.g., due to different VitePress behavior across Node versions), the PR check could pass but the deployment build could fail, or vice versa.

Recommendation: Consider one of:

  • Align with deploy-pages.yml and use node-version: 20 to match the actual deployment environment exactly.
  • Or, if using 22 is intentional (to validate against the latest LTS), pin a specific minor version (e.g., 22.x) rather than 22 to ensure deterministic behavior.

2. Consider adding workflow_dispatch: trigger (docs-build-check.yml:4-7)

The other two docs workflows (deploy-pages.yml, docs-bilingual-check.yml) both include workflow_dispatch: to allow manual re-runs. Adding it to this workflow would be useful for ad-hoc validation, e.g., after resolving a build failure.


✅ Working directory & lockfile

  • docs/package-lock.json exists, so npm ci will succeed.
  • fetch-depth: 0 is NOT used in checkout; this is fine since the VitePress config does not use lastUpdated (confirmed by reading docs/.vitepress/config.mjs).

Conclusion

The workflow is correct and ready to merge. The two suggestions above are minor improvements, not blockers.

@fslongjin fslongjin merged commit 75aac8f into master May 21, 2026
3 checks passed
@fslongjin fslongjin deleted the feature/docs-build-check branch May 21, 2026 08:21
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.

1 participant