-
Notifications
You must be signed in to change notification settings - Fork 333
[wip]feat: add auot build main module docs yml #3909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
6264dec
24fc500
e11d946
a698cec
a9d9b8f
fb2a4d5
7ee298e
f0e27b0
a6ee7cc
34f674a
5c0b64f
2dd4f02
9151f9b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,72 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Auto Build Main Module Docs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| branches: [dev] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| branches: [dev] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| verify-main-build: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pull-requests: write | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: webfactory/ssh-agent@v0.8.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ssh-private-key: ${{ secrets.SUBMODULE_SSH_KEY }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout submodule repo | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fetch-depth: 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| token: ${{ secrets.PAT_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout main repository | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 克隆主仓库 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git clone https://github.com/opentiny/docs.git docs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cd docs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 更新子模块到PR分支的版本 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git submodule sync --recursive | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git submodule update --init --recursive | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 获取PR分支的最新提交 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cd ./tiny-vue | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BRANCH_NAME="${{ github.head_ref }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git fetch origin $BRANCH_NAME | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git checkout $BRANCH_NAME | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 回到主仓库根目录 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cd ../ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 更新主仓库中的子模块引用 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git add tiny-vue | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git commit -m "Update submodule to PR version" || echo "No changes" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Setup pnpm | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: pnpm/action-setup@v3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| version: 9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Run main repo build | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: build | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: ./docs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pnpm i | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 如果使用VitePress | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pnpm build | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v3 | |
| with: | |
| version: 9 | |
| - name: Run main repo build | |
| id: build | |
| working-directory: ./docs | |
| run: | | |
| pnpm i | |
| # 如果使用VitePress | |
| pnpm build | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v3 | |
| with: | |
| version: 9 | |
| - name: Run main repo build | |
| id: build | |
| working-directory: ./docs | |
| run: | | |
| pnpm i | |
| # 如果使用VitePress | |
| pnpm build |
🤖 Prompt for AI Agents
.github/workflows/auto-build-main-module-docs.yml lines 50-61: the workflow
configures pnpm but never installs Node.js, which can cause inconsistent builds
and prevents enabling pnpm caching; add a step before the "Setup pnpm" step to
run actions/setup-node@v3 with a sensible node-version (or reference your
project’s engines field) and enable the pnpm cache (e.g., set cache: "pnpm" and
cache-dependency-path to your pnpm lockfile) so Node is present and pnpm caching
works reliably.
Uh oh!
There was an error while loading. Please reload this page.