Repository navigation
ci(docs): fix gh-pages deploy race and align docs workflows with Apache practice - #1206
Merged
Merged
Conversation
…he practice The docs deploy workflow ran on every push to main and each run takes about 30 minutes (full-history checkout plus Docusaurus build), so bursts of merges race their final 'git push --force gh-pages'. On 2026-10-08 the deploy triggered by the Java-only commit a559aa1 failed with "cannot lock ref 'refs/heads/gh-pages'" because a concurrent deploy recreated the branch seconds earlier (run 37812706645). - deploy-docs.yml: trigger only on website/** and .asf.yaml changes so Java-only merges no longer deploy; queue deploys through a non-cancelling concurrency group instead of racing; add workflow_dispatch for manual redeploys; cache the pnpm store. - ci-docs/preview-docs/deploy-docs: least-privilege permissions (write only where needed), persist-credentials: false on checkout, each workflow file added to its own path filter, and unified 'Docs <role>' naming, following common Apache practice (iceberg, superset). Signed-off-by: gongzhongqiang <gongzhongqiang@apache.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of the pull request
Fixes the recurring red
Deploy Docusaurus to GitHub Pagesruns onmain, and aligns the three docs workflows with conventions used by other Apache projects (iceberg, superset).Most recent occurrence: run 37812706645 (triggered by the Java-only commit a559aa1, #1160) failed at the final push step:
Root cause: the deploy workflow triggers on every push to
main, and each run takes ~30 minutes (full-history checkout + Docusaurus build). When several PRs merge within a window, multiple deploy runs reach the finalgit push --force gh-pagesconcurrently and the losers get rejected by ref-lock contention. On Oct 8 five pushes landed within 24 minutes, and two deploys pushed togh-pagesat the same second.What's changed?
deploy-docs.yml
pathsfilter (website/**,.asf.yaml, the workflow itself): Java-only merges like fix: treat BigDecimal boolean ones by numeric value #1160 no longer trigger a deploy at all — the failing run above would not have existed.concurrency: group: deploy-docswithcancel-in-progress: false: genuine docs pushes queue and publish serially instead of racing on thegh-pagesref. Deliberately not cancelling, to avoid killing a publish midway and leaving a half-updated site.workflow_dispatchfor manual redeploys.actions/setup-node.contents: read,contents: writeonly on thedeployjob (the pattern used by iceberg'ssite-ci.yml).ci-docs.yml / preview-docs.yml
Docs CI/Docs Preview/Docs Deploy, matching the "Docs <role>" style of apache/iceberg (Docs Build CI) and apache/superset (Docs Deployment,Docs Testing).contents: read; preview additionallypull-requests: write, required by the Netlify action's PR comment).persist-credentials: falseon checkouts (zizmor hygiene, as in iceberg/superset workflows).preview-docs.yml: added the missing concurrency cancellation, consistent withci-docs.yml.Notes:
fetch-depth: 0is kept — Docusaurus last-updated timestamps need git history.Checklist