Add GitHub Actions workflow to deploy JSDoc to GitHub#1490
Add GitHub Actions workflow to deploy JSDoc to GitHub#1490minggangw wants to merge 3 commits intoRobotWebTools:developfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an automated GitHub Actions pipeline to build and deploy versioned JSDoc output to GitHub Pages, replacing the prior manual npm run docs:gh-pages + push-to-gh-pages process.
Changes:
- Introduces a new
deploy-docs.ymlworkflow to build docs ondocs-*tag pushes (and via manual dispatch) and deploy to GitHub Pages. - Updates the JSDoc workflow README with instructions for the new CI-based deployment and basic testing guidance.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
tools/jsdoc/README.md |
Documents the new CI-based docs build/deploy workflow and how to trigger/test it. |
.github/workflows/deploy-docs.yml |
New GitHub Actions workflow to build JSDoc, upload as Pages artifact, and deploy to GitHub Pages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - **Tag push** matching `docs-*` (e.g. `git tag docs-1.9.0 && git push origin docs-1.9.0`) — builds and deploys automatically. | ||
| - **Manual dispatch** from the Actions tab — includes a `dry_run` toggle | ||
| (defaults to `true`). Set it to `false` to deploy. | ||
|
|
There was a problem hiding this comment.
The workflow is guarded by if: github.repository == 'RobotWebTools/rclnodejs' in the build job, so manual dispatches (and tag pushes) in forks will result in a skipped build. Consider documenting this constraint here (e.g., “only runs in the upstream RobotWebTools/rclnodejs repo”) to avoid confusion when contributors try to test it from their fork’s Actions tab.
| These workflow runs only execute in the upstream `RobotWebTools/rclnodejs` | |
| repository. If you trigger the workflow from a fork, the build job is skipped, | |
| so manual dispatches and `docs-*` tag pushes there will not run the docs build. |
| - Run the workflow manually with `dry_run` enabled to verify the build | ||
| succeeds without deploying. | ||
| - Push a `docs-test` tag to trigger a full build + deploy, then clean up: |
There was a problem hiding this comment.
The “Push a docs-test tag to trigger a full build + deploy” guidance will update the live GitHub Pages site (since docs-* tags deploy by default). Consider adding an explicit warning that this is a production deployment and should only be used when it’s acceptable to update published docs (or recommend using workflow_dispatch with dry_run first).
| - Run the workflow manually with `dry_run` enabled to verify the build | |
| succeeds without deploying. | |
| - Push a `docs-test` tag to trigger a full build + deploy, then clean up: | |
| - Run the workflow manually with `dry_run` enabled first to verify the build | |
| succeeds without deploying. | |
| - Only push a `docs-test` tag when it is acceptable to update the published | |
| GitHub Pages site: this trigger performs a real production build + deploy | |
| for `docs-*` tags. Afterward, clean up the tag with |
Automate the JSDoc deployment that was previously a manual
npm run docs:gh-pages+ push-to-gh-pagesprocess. The workflow leverages the existinggithub-pagesdeployment environment.Trigger
docs-*(e.g.docs-1.9.0) — builds and deploysworkflow_dispatchwith adry_runtoggle (defaults totrue) — build-only by default, deploy whendry_runis uncheckedBuild job
fetch-depth: 0) with tags, plus explicitorigin/gh-pagesfetch — required byregenerate-published-docs.jsto discover and preserve previously published versionsnpm run docs:gh-pagesto stage the full docs tree underbuild/gh-pages-docs/upload-pages-artifactDeploy job
dry_runistruedeploy-pages@v5Changes
.github/workflows/deploy-docs.ymlFix: #1489