From dfdce1fd6f8ff835a4601b2d6eeedd3f7e816a0b Mon Sep 17 00:00:00 2001 From: snowy Date: Wed, 28 Aug 2024 11:52:22 +0800 Subject: [PATCH] =?UTF-8?q?:memo:=20=E6=B5=8B=E8=AF=95=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-docs.yml | 57 +++++++++++++------------------ 1 file changed, 23 insertions(+), 34 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index e8bb886..2c9d9c6 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -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 \ No newline at end of file + - 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 \ No newline at end of file