chore(docs): cf turnstile #221
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: [main] | |
| paths: [docs/**] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 签出代码 | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: 安装依赖 | |
| run: npm i -D | |
| working-directory: docs | |
| - name: 删除部分文件 | |
| run: rm -r edge-functions | |
| working-directory: docs | |
| - name: 构建文档 | |
| run: npm run docs:build | |
| working-directory: docs | |
| - name: 提交文件 | |
| run: | | |
| git init | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git add . && git commit -m "更新文档" | |
| working-directory: docs/.vitepress/dist | |
| - name: 推送到 GitHub | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: pages | |
| force: true | |
| directory: docs/.vitepress/dist |