mirror of
https://github.com/snowykami/mbcp.git
synced 2024-11-25 07:45:03 +08:00
📝 测试文档部署
This commit is contained in:
parent
f343b54051
commit
dfdce1fd6f
57
.github/workflows/deploy-docs.yml
vendored
57
.github/workflows/deploy-docs.yml
vendored
@ -44,39 +44,28 @@ jobs:
|
||||
python -m pip install pydantic
|
||||
python docs/mkdoc.py
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
run: |-
|
||||
cd docs
|
||||
npm install
|
||||
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v4
|
||||
|
||||
- name: Install node dependencies
|
||||
run: |-
|
||||
cd docs
|
||||
npm ci
|
||||
|
||||
- name: Build with VitePress
|
||||
run: |-
|
||||
cd docs
|
||||
npm run docs:build # 或 pnpm docs:build / yarn docs:build / bun run docs:build
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
- name: 安装 pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
path: docs/.vitepress/dist
|
||||
run_install: true
|
||||
version: 8
|
||||
|
||||
# 部署工作
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
name: Deploy
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
- name: 设置 Node.js
|
||||
run: |-
|
||||
cd docs
|
||||
pnpm install
|
||||
|
||||
- name: 构建文档
|
||||
env:
|
||||
NODE_OPTIONS: --max_old_space_size=8192
|
||||
run: |-
|
||||
cd docs
|
||||
pnpm run docs:build
|
||||
> .vuepress/dist/.nojekyll
|
||||
|
||||
- name: 部署文档
|
||||
uses: JamesIves/github-pages-deploy-action@v4
|
||||
with:
|
||||
# 这是文档部署到的分支名称
|
||||
branch: gh-pages
|
||||
folder: docs/.vuepress/dist
|
Loading…
Reference in New Issue
Block a user