Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Deploy JSDoc to GitHub Pages

on:
push:
tags:
- 'docs-*'
workflow_dispatch:
inputs:
dry_run:
description: 'Build docs only (skip deploy to Pages)'
required: true
type: boolean
default: true

concurrency:
group: deploy-docs
cancel-in-progress: false

permissions:
contents: read
pages: write
id-token: write

jobs:
build:
if: github.repository == 'RobotWebTools/rclnodejs'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true

- name: Fetch gh-pages branch
run: git fetch origin gh-pages:refs/remotes/origin/gh-pages

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24.x

- name: Install dependencies
run: npm ci --ignore-scripts

- name: Build docs
run: npm run docs:gh-pages

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v5
with:
path: build/gh-pages-docs

deploy:
needs: build
if: ${{ !(inputs.dry_run == true) }}
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
25 changes: 25 additions & 0 deletions tools/jsdoc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,31 @@ For a new release such as `1.9.0`:
- `build/gh-pages-docs/.nojekyll`
6. Publish the contents of `build/gh-pages-docs/` to the `gh-pages` branch.

## GitHub Actions Deployment

The `deploy-docs.yml` workflow (`.github/workflows/deploy-docs.yml`) automates
building and deploying docs to GitHub Pages.

### Triggers

- **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.

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.
### What it does

1. Full checkout with all tags and the `origin/gh-pages` branch.
2. Runs `npm run docs:gh-pages` to stage the docs tree.
3. Uploads the staged output as a Pages artifact.
4. Deploys to GitHub Pages (skipped when `dry_run` is `true`).

### Testing

- 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:

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

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

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).

Suggested change
- 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

Copilot uses AI. Check for mistakes.
`git tag -d docs-test && git push origin :refs/tags/docs-test`.

## Manual Landing Page Rebuild

If the staged docs tree already exists and you only want to rebuild
Expand Down
Loading