Repository navigation
chore(release): v2.4.0 #78
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: Documentation Build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| # allow actions to edit the project | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Copy project to machine | |
| uses: actions/checkout@v3 | |
| with: | |
| # 确保可以 Dumi 可以拿到正确的最后更新时间,当配置 themeConfig.lastUpdated 为 true | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v3 | |
| with: | |
| node: 22 | |
| - name: Restore node_modules | |
| id: restore-node-modules | |
| uses: actions/cache/restore@v3 | |
| with: | |
| path: node_modules | |
| key: cache-${{ hashFiles('package-lock.json') }} | |
| - name: Install dependencies | |
| if: steps.restore-node-modules.outputs.cache-hit != 'true' | |
| run: npm install | |
| - name: Cache node_modules | |
| if: steps.restore-node-modules.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v3 | |
| with: | |
| path: node_modules | |
| key: ${{ steps.restore-node-modules.outputs.cache-primary-key }} | |
| - name: Install swc | |
| run: npm install @swc/core@1.13.20 | |
| - name: Build docs | |
| run: npm run docs:build | |
| - name: Deploy | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: docs-dist | |
| branch: gh-pages | |
| clean: true | |
| clean-exclude: CNAME |