Update deploy-docs.yml to use updated actions and Node.js version #76
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
| name: 部署文档 | |
| on: | |
| push: | |
| branches: | |
| # 确保这是你正在使用的分支名称 | |
| - vuepress2.0 | |
| permissions: | |
| contents: write | |
| jobs: | |
| deploy-gh-pages: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # Install pnpm package manager / 安装 pnpm 包管理器 | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| version: 10 | |
| run_install: false | |
| # Setup Node.js environment / 设置 Node.js 环境 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' # Use Node.js 24 / 使用 Node.js 24 | |
| cache: 'pnpm' # Cache pnpm dependencies / 缓存 pnpm 依赖 | |
| # Install project dependencies / 安装项目依赖 | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: 构建文档 | |
| env: | |
| NODE_OPTIONS: --max_old_space_size=8192 | |
| run: |- | |
| pnpm run docs:build | |
| > src/.vuepress/dist/.nojekyll | |
| - name: 部署文档 | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| # 这是文档部署到的分支名称 | |
| branch: gh-pages | |
| folder: src/.vuepress/dist | |