From 8056abfd4f48e6f1de27cc147cbe3f8907ed46a7 Mon Sep 17 00:00:00 2001 From: Josp3r <100178848+Josp3r@users.noreply.github.com> Date: Mon, 6 May 2024 16:50:49 +0800 Subject: [PATCH] Create deploy.yml for docs --- .github/workflows/deploy.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..21f9836 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,29 @@ +name: Deploy VitePress to GitHub Pages + +on: + push: + branches: + - main + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: '16' + + - name: Install dependencies + run: pnpm install + + - name: Build VitePress + run: pnpm run docs:build --prefix docs + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/.vitepress/dist # 确保指向正确的构建输出目录