From 3b82e88cd942fa127abb53158dec4e02dd976e6b Mon Sep 17 00:00:00 2001 From: Jerry Date: Thu, 5 Jun 2025 21:05:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d38ceae..400a318 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,6 +8,7 @@ on: jobs: build-and-deploy: runs-on: ubuntu-latest + defaults: run: working-directory: src/frontend @@ -19,12 +20,27 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: '23' + node-version: '22' + cache: 'pnpm' - name: Install pnpm run: npm install -g pnpm - - run: pnpm install - - run: pnpm run build - - run: npx gh-pages -d build + + - name: Install dependencies + run: pnpm install + + - name: Build project + run: pnpm run build + + - name: Copy 404.html for React Router support + run: cp build/index.html build/404.html + + - name: Configure Git identity + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + - name: Deploy to GitHub Pages + run: npx gh-pages -d build env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}