From 825b49ede820b8750f5e02cef6a8f66558ec74a0 Mon Sep 17 00:00:00 2001 From: easterNday <849919718@qq.com> Date: Mon, 26 Jun 2023 16:46:30 +0800 Subject: [PATCH] ci: add deploy action --- .github/workflows/deploy.yml | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 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..ddb8157 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,46 @@ +name: Deploy +on: + workflow_dispatch: {} + push: + branches: + - main +permissions: + contents: write +jobs: + build-and-deploy: + concurrency: ci-${{ github.ref }} + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20] + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup pnpm ⚡️ + uses: pnpm/action-setup@v2 + with: + version: 8 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + + - name: Install dependencies ⚡️ + run: pnpm install --frozen-lockfile + + - name: Build 🛠️ + run: pnpm docs:build + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: ArbitrarilyTong/.vitepress/dist + branch: gh-pages