From 434f67b2b5cb3f518e898cb94520228c8e24cfc8 Mon Sep 17 00:00:00 2001 From: ruabbit <34975428+ruaabbit@users.noreply.github.com> Date: Fri, 6 Dec 2024 10:35:22 +0800 Subject: [PATCH] actions: Create Github Pages Deploy Workflow Again --- .github/workflows/deploy.yml | 64 ++++++++++++++++++++++++++++++++++++ 1 file changed, 64 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..954dfae --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,64 @@ +name: Deploy VitePress Site +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +env: + TZ: Asia/Shanghai + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20] + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Install pnpm + uses: pnpm/action-setup@v3 + with: + version: latest + run_install: false + + - name: Install dependencies + run: pnpm install + + - name: Build VitePress site + run: pnpm docs:build + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: .vitepress/dist + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4