Skip to content

docs: overhaul the documentation site and how it is published - #405

Merged
BobDu merged 1 commit into
jenkinsci:mainfrom
BobDu:ci/docs-github-pages-actions
Jul 29, 2026
Merged

docs: overhaul the documentation site and how it is published#405
BobDu merged 1 commit into
jenkinsci:mainfrom
BobDu:ci/docs-github-pages-actions

Conversation

@BobDu

@BobDu BobDu commented Jul 29, 2026

Copy link
Copy Markdown
Member

Refs #206.

⚠️ Needs a repository setting change before this is merged

Settings → Pages → Build and deployment → Source has to be switched from the gh-pages branch to GitHub Actions. While the source is still a branch, a deployment originating from main is rejected, so merging first would just produce one red run. The site keeps serving its current content until the first Actions deployment lands.

Once it has deployed successfully, the gh-pages branch and the GH_TOKEN repository secret can both be deleted.

Publishing

The site was built in CI and pushed to gh-pages with peaceiris/actions-gh-pages, authenticated by a token kept in the GH_TOKEN repository secret. GitHub's own actions upload the build as an artifact and deploy it through an OIDC-verified deployment instead, so nothing has to be stored and no build output is committed to a branch. This is what maven-hpi-plugin, wxwork-notification-plugin, jelly and job-dsl-plugin already do.

Along with it: npm ci rather than npm install so the tracked lock file is what gets installed; the trigger narrowed to the paths that can change the built site, instead of rebuilding and redeploying on every push to main including the Java-only ones; and the build skipped on forks, which have no Pages site to deploy to.

bin/docs-release.sh is removed. It was the manual half of the same scheme and has not worked since the VitePress migration moved the output out of docs-dist/ in September 2022 — AGENTS.md already told contributors not to run local release scripts.

I smoke-tested the whole pipeline on my fork before opening this: build → artifact → OIDC deployment, green, serving.

What was broken

[受限的 markdonw](#受限的 markdonw) never rendered as a link — the anchor contains a space, so markdown-it left it as literal text. The pipeline page has been showing that raw markdown in two of its tables. The target section is on another page and the word is misspelt as well.

#MsgTypeEnum, #BtnLayoutEnum, #ButtonModel never resolved; heading ids are lowercased
two ding-doc.oss-cn-beijing.aliyuncs.com screenshots 403 AccessDenied: Access denied by bucket policy
plugins.jenkins.io/dingtalk 404 — the plugin is published as dingding-notifications, which the home page badge already had right
liuweigl.github.io/dingtalk-plugin in an action card example 404
two dingtalk.com/qidian/help-detail-* references on the DTMD page redirect to the help centre's front page

The five external screenshots in 效果展示 are replaced with the ones this repository already ships, so the section no longer depends on someone else's bucket. The DTMD example had the robot send an insult — the code says something civil now, though the screenshot still shows the old exchange and should be retaken by someone with a client handy; I only renamed the file to fix its dtmt spelling and left the pixels alone.

What disagreed with the code

The pipeline page's syntax block was missing singleUrl, documented at as a List when it is a Set, gave the default title as Jenkins 通知 when it is Jenkins 构建通知, and its copy of BtnLayoutEnum misspelt horizontal.

环境变量 listed two of the eight variables the plugin injects, and none of the things that make them surprising:

  • PROJECT_* is the project, JOB_* is the build
  • EXECUTOR_NAME and EXECUTOR_MOBILE are read before they are written, so a build can override them
  • none of the eight exist in the dingtalk step — they are written into the notification's own snapshot of the environment. That is the behaviour behind Pipeline 中无法使用插件环境变量 #206, answered in that thread back in 2023 but never written down. Freestyle 项目高级功能 implied the opposite.

The security policy section warned that the keyword has to appear in the message, when DingTalkSender.addKeyWord appends it for you on all four message types.

What was missing

The raw mode had no documentation at all, so 自定义消息 is a new page: what the built-in message contains, what disabling it costs (no buttons, MARKDOWN only and therefore no tappable mention on mobile), that the title stays out of your hands, and how to rebuild the pieces with environment variables. 快速开始 gained the six notice occasions and the boundary of the three security policies — only two of them need anything on the Jenkins side.

The site itself

It declared lang="en-US" while being entirely in Chinese, had no search, and set lastUpdatedText without enabling lastUpdated — enabling it is why the checkout now needs the full history. The theme's remaining English labels are translated, the logo that was sitting unreferenced in assets/ is now the home page's, and the home page uses the hero layout. Public files move to docs/public, VitePress's default, which lets the explicit vite.publicDir go.

CONTRIBUTING.md told contributors to install yarn although the repository tracks package-lock.json and CI runs npm ci, and pointed at two jenkins-zh.cn articles whose domain no longer resolves and at the retired Confluence wiki.

Verification

npm run docs:build after each round, plus a scan of the built output for anchors without a matching id, markdown link syntax surviving outside <code>, and local image targets that do not exist — 16 pages, none left. Every external link in the docs checked individually; the only remaining non-200s are the name.com placeholders inside a syntax example.

The three binary changes in this PR are renames at 100% similarity; no image content is modified.

The site was published by building it in CI and pushing the output to the
gh-pages branch with a third-party action, authenticated by a token stored in the
GH_TOKEN repository secret. GitHub has since provided a first-party path — upload
the build as an artifact and hand it to a deployment authorised through OIDC —
which needs no stored token and commits no build output to a branch. Other
jenkinsci repositories already publish this way, among them maven-hpi-plugin and
wxwork-notification-plugin. npm ci replaces npm install so the tracked lock file
is what actually gets installed, the trigger is narrowed to the paths that can
change the built site rather than every push to main, and a fork skips the build
since it has no Pages site to deploy to. bin/docs-release.sh goes with the old
scheme; it was its manual half and has not worked since the VitePress migration
moved the build output out of docs-dist/ in September 2022, and AGENTS.md already
told contributors not to run local release scripts.

Going over every page against the code and checking every link then turned up a
fair amount that was simply broken.

`[受限的 markdonw](#受限的 markdonw)` never rendered as a link at all: the anchor
contains a space, so markdown-it left the whole thing as literal text, which is
what the pipeline page has been showing in two of its tables. The target section
does not live on that page either, and the word is misspelt. The same page had
three anchors written in CamelCase, which never resolved because heading ids are
lowercased, and two screenshots hosted in an Alibaba Cloud bucket that now answers
403; those two and three others are replaced by the screenshots this repository
already ships. Its syntax block was missing `singleUrl`, `at` was documented as a
List when it is a Set, the default title has been `Jenkins 构建通知` rather than
`Jenkins 通知` for some time, and its copy of BtnLayoutEnum misspelt horizontal.

The install link pointed at plugins.jenkins.io/dingtalk, which is a 404 — the
plugin is published as dingding-notifications, as the badge on the home page
already had it. An action card example still linked to the previous maintainer's
personal site, also gone. The DTMD page had the robot send an insult; the code now
says something civil, though the screenshot still shows the old exchange and wants
retaking. Two of that page's three references were help-center links that now
redirect to the help centre's front page. One example mentioned a twelve-digit
number where a mobile has eleven.

`环境变量` listed two of the eight variables the plugin injects, and none of the
things that make them surprising: `PROJECT_*` is the project while `JOB_*` is the
build, `EXECUTOR_NAME` and `EXECUTOR_MOBILE` are read before they are written so
they can be overridden, and none of the eight exist in the `dingtalk` step, which
`Freestyle 项目高级功能` implied they did. The security policy section warned that
the keyword has to appear in the message, when the plugin appends it for you.

Nothing documented the raw mode at all, so `自定义消息` is a new page: what the
built-in message contains, what disabling it costs (no buttons, MARKDOWN only,
hence no tappable mention on mobile), and that the title stays out of your hands.
`快速开始` gained the six notice occasions and the boundary of the three security
policies, since only two of them need anything on the Jenkins side.

The site itself declared `lang="en-US"` while being entirely in Chinese, had no
search, and set `lastUpdatedText` without enabling `lastUpdated`; enabling it is
why the checkout now needs the full history. The theme's remaining English labels
are translated, the logo that was sitting unreferenced in assets/ is now the home
page's, and the home page uses the hero layout. Public files move to `docs/public`,
VitePress's default, so the explicit `vite.publicDir` can go.

CONTRIBUTING told contributors to install yarn although the repository tracks
package-lock.json and CI runs npm ci, and pointed at two jenkins-zh.cn articles
whose domain no longer resolves and at the retired Confluence wiki.

Publishing from main requires the repository's Pages source to be set to GitHub
Actions; afterwards the gh-pages branch and the GH_TOKEN secret can both go away.

Signed-off-by: BobDu <i@bobdu.cc>
@BobDu
BobDu merged commit 5b2af97 into jenkinsci:main Jul 29, 2026
16 checks passed
@BobDu
BobDu deleted the ci/docs-github-pages-actions branch July 30, 2026 10:17
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