From c088b760279ee27a8b4d9e76eb190dbb32eca443 Mon Sep 17 00:00:00 2001 From: sshwy Date: Thu, 29 Feb 2024 13:28:09 +0800 Subject: [PATCH] ci: fix docs workflow --- .github/workflows/deploy.yml | 42 +++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 291e082..6af88e6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,7 +14,8 @@ jobs: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 with: fetch-depth: 0 @@ -28,26 +29,41 @@ jobs: with: version: 'latest' - - name: Setup Node & Yarn + - name: Build WASM + run: wasm-pack build --features wasm + + - name: Install Node.js uses: actions/setup-node@v3 with: - node-version: 19 - # cache: yarn - # cache-dependency-path: web/yarn.lock - - working-directory: ./web + node-version: 18 + + - name: Install pnpm + uses: pnpm/action-setup@v3 + with: + version: 8 + run_install: false + + - name: Get pnpm store directory + shell: bash run: | - corepack enable - corepack prepare yarn@stable --activate + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - name: Build WASM - run: wasm-pack build --features wasm + - name: Setup pnpm cache + uses: actions/cache@v3 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + working-directory: ./web + run: pnpm install - name: Build Docs working-directory: ./web run: | - rm -rf yarn.lock - YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn - yarn docs:build-github-pages + pnpm docs:build-github-pages - uses: actions/configure-pages@v2 - uses: actions/upload-pages-artifact@v1