From a20b160ac701f6f908e24ef0afc9b7e8afe185d2 Mon Sep 17 00:00:00 2001 From: Jerry Date: Thu, 5 Jun 2025 22:04:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0githubAction=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7c27074..1011b70 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,14 +7,8 @@ on: jobs: deploy: runs-on: ubuntu-latest - # defaults: - #run: - # working-directory: src/frontend - steps: - uses: actions/checkout@v4 - - name: Navigate to project - run: cd src/frontend && echo "PROJECT_DIR=$(pwd)" >> $GITHUB_ENV - name: Setup pnpm uses: pnpm/action-setup@v4 @@ -26,7 +20,7 @@ jobs: with: node-version: 20 cache: 'pnpm' - cache-dependency-path: src/frontend/pnpm-lock.yaml + cache-dependency-path: 'src/frontend/pnpm-lock.yaml' - name: Install dependencies working-directory: src/frontend @@ -36,8 +30,11 @@ jobs: working-directory: src/frontend run: pnpm run build - - name: Deploy + - name: Deploy to GitHub Pages working-directory: src/frontend - run: npx gh-pages -d build + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + npx gh-pages -d build env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}