Skip to content

fix(ci): install cnwebsite deps before build#1023

Merged
sunnylqm merged 1 commit into
productionfrom
fix/gh-pages-build
May 13, 2026
Merged

fix(ci): install cnwebsite deps before build#1023
sunnylqm merged 1 commit into
productionfrom
fix/gh-pages-build

Conversation

@sunnylqm
Copy link
Copy Markdown

@sunnylqm sunnylqm commented May 13, 2026

cnwebsite 不在 root yarn workspaces 里,根目录 yarn install 不会安装 cnwebsite 的依赖(包括 @docusaurus/core),导致 CI 构建报 docusaurus: not found (exit 127)。

修复:

  1. Install 步骤增加 cd cnwebsite && yarn install
  2. paths 过滤器增加 .github/workflows/gh-pages.yml,确保 workflow 变更也能触发构建

Summary by CodeRabbit

  • Chores
    • Updated GitHub Pages deployment workflow configuration to improve build process consistency and self-triggering capabilities.

Review Change Stack

@netlify
Copy link
Copy Markdown

netlify Bot commented May 13, 2026

Deploy Preview for reactnativecn failed. Why did it fail? →

Name Link
🔨 Latest commit f402c53
🔍 Latest deploy log https://app.netlify.com/projects/reactnativecn/deploys/6a03ecf28f2c8000083544b7

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Warning

Rate limit exceeded

@sunnylqm has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 54 minutes and 47 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7f831086-45f3-490c-9966-15ea82def893

📥 Commits

Reviewing files that changed from the base of the PR and between 0a60964 and f402c53.

📒 Files selected for processing (2)
  • .github/workflows/gh-pages.yml
  • package.json
📝 Walkthrough

Walkthrough

The GitHub Pages workflow is updated to include itself as a triggering path in the push filter, and the dependency installation step is changed from a single root-level yarn install to a multiline script that installs dependencies from within the cnwebsite subdirectory.

Changes

GitHub Pages Workflow Configuration

Layer / File(s) Summary
Workflow self-trigger and installation directory
.github/workflows/gh-pages.yml
The on.push.paths filter now includes .github/workflows/gh-pages.yml so the workflow triggers on changes to itself. The install step changes from a single-line root install to a multiline script that runs yarn install from the cnwebsite subdirectory.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

📜 A workflow learns to watch itself,
Like a rabbit gazing in the looking-glass.
From root to cnwebsite it hops,
Dependencies gathered with care,
Self-aware automation blooms! 🌱

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main fix: installing cnwebsite dependencies before the build step in the CI workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/gh-pages-build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/gh-pages.yml (1)

27-30: ⚡ Quick win

Consider optimizing the yarn cache for cnwebsite's lockfile.

The install step correctly fixes the build failure by installing cnwebsite dependencies. However, the cache: yarn configuration at line 24 defaults to the root yarn.lock. If cnwebsite has its own yarn.lock, you may improve cache performance by specifying the cache key path.

⚡ Optional cache optimization
       - name: Set up Node.js
         uses: actions/setup-node@v6
         with:
           node-version: "24"
-          cache: yarn
+          cache: yarn
+          cache-dependency-path: |
+            yarn.lock
+            cnwebsite/yarn.lock

Alternatively, if only cnwebsite/yarn.lock is relevant for this workflow, you could simplify to:

       - name: Set up Node.js
         uses: actions/setup-node@v6
         with:
           node-version: "24"
-          cache: yarn
+          cache: yarn
+          cache-dependency-path: cnwebsite/yarn.lock
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/gh-pages.yml around lines 27 - 30, The workflow currently
caches Yarn using the root lockfile but CN website dependencies live in the
cnwebsite subfolder; update the cache configuration that uses "cache: yarn" so
it keys off cnwebsite/yarn.lock (or otherwise scopes the cache to the cnwebsite
working directory) to ensure the cache is specific to the cnwebsite lockfile;
locate the workflow's cache block referencing "cache: yarn" and adjust the
key/path to include "cnwebsite/yarn.lock" and ensure the install steps (the cd
cnwebsite and yarn install) will hit that cache.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/gh-pages.yml:
- Around line 27-30: The workflow currently caches Yarn using the root lockfile
but CN website dependencies live in the cnwebsite subfolder; update the cache
configuration that uses "cache: yarn" so it keys off cnwebsite/yarn.lock (or
otherwise scopes the cache to the cnwebsite working directory) to ensure the
cache is specific to the cnwebsite lockfile; locate the workflow's cache block
referencing "cache: yarn" and adjust the key/path to include
"cnwebsite/yarn.lock" and ensure the install steps (the cd cnwebsite and yarn
install) will hit that cache.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2e61b8c8-d5f1-4c7f-9fcb-4f21c8e587cc

📥 Commits

Reviewing files that changed from the base of the PR and between 3ee75e7 and 0a60964.

📒 Files selected for processing (1)
  • .github/workflows/gh-pages.yml

@sunnylqm sunnylqm force-pushed the fix/gh-pages-build branch from 0a60964 to 9a41d0b Compare May 13, 2026 03:14
cnwebsite was missing from root workspaces, so yarn install in CI
did not install its dependencies (including @docusaurus/core),
causing 'docusaurus: not found' during build.

Also add workflow file to paths filter so workflow changes trigger builds.
@sunnylqm sunnylqm force-pushed the fix/gh-pages-build branch from 9a41d0b to f402c53 Compare May 13, 2026 03:16
@sunnylqm sunnylqm merged commit 2e6ce7b into production May 13, 2026
1 of 5 checks passed
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