From 17e1f6b8054e3ba75eff7ef3802e2463203b8a75 Mon Sep 17 00:00:00 2001 From: BruceChen Date: Thu, 3 Nov 2022 08:32:54 +0800 Subject: [PATCH] Create docs.yml --- .github/workflows/docs.yml | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..85c5358f --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,46 @@ +name: docs + +on: + push: + branches: + - main + paths-ignore: + - '**/__tests__/**' + workflow_dispatch: + +jobs: + docs: + runs-on: ubuntu-latest + + env: + NODE_ENV: 'production' + NODE_VERSION: '16' + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@v2 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + cache: pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build documentation site + run: pnpm docs:release + + - name: Deploy to GitHub Pages + uses: crazy-max/ghaction-github-pages@v2.2.0 + with: + repo: MCCTeam/MCCTeam.github.io + target_branch: main + build_dir: docs/.vuepress/dist + env: + GH_PAT: ${{ secrets.GH_PAGES_TOKEN }}