-
Notifications
You must be signed in to change notification settings - Fork 333
feat: add auot build main module docs yml #3907
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
Closed
+72
−0
Closed
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| 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 | ||
wuyiping0628 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # 回到主仓库根目录 | ||
| cd ../ | ||
|
|
||
| # 更新主仓库中的子模块引用 | ||
| git add tiny-vue | ||
| git commit -m "Update submodule to PR version" || echo "No changes" | ||
wuyiping0628 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v3 | ||
| with: | ||
| version: 9 | ||
|
|
||
| - name: Run main repo build | ||
| working-directory: ./docs | ||
| run: | | ||
| pnpm i | ||
| # 如果使用VitePress | ||
| pnpm build | ||
|
|
||
| - name: Update PR status | ||
| if: always() | ||
| run: | | ||
| # 检查构建是否成功 | ||
| if [ ${{ job.status }} == 'success' ]; then | ||
| echo "✅ 主仓库构建成功" | ||
| else | ||
| echo "❌ 主仓库构建失败" | ||
| exit 1 | ||
| fi | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.