From ab9da273eb88980668a97f6b5bc4ce739a84e05e Mon Sep 17 00:00:00 2001 From: Hanxven Date: Mon, 29 Jul 2024 17:19:53 +0800 Subject: [PATCH] chore: Add GitHub Actions workflow for deploying VitePress site to Pages --- .github/workflows/pages.yml | 53 +++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/pages.yml diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 00000000..ee369725 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,53 @@ +name: Deploy VitePress site to Pages + +on: + push: + branches: [pages] + + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: pnpm/action-setup@v3 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Install dependencies + run: pnpm install + - name: Build with VitePress + run: pnpm docs:build + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs/.vitepress/dist + + 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