From 93a671de201c5b8875c66f447f08a8a1d7083ada Mon Sep 17 00:00:00 2001 From: Jerry Date: Thu, 5 Jun 2025 22:10:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=BA=E5=88=B6bot=E4=BD=BF=E7=94=A8token?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E8=80=8C=E4=B8=8D=E6=98=AFhttps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1011b70..6364db5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,14 +7,10 @@ on: jobs: deploy: runs-on: ubuntu-latest + steps: - uses: actions/checkout@v4 - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 9 - - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -22,6 +18,11 @@ jobs: cache: 'pnpm' cache-dependency-path: 'src/frontend/pnpm-lock.yaml' + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + - name: Install dependencies working-directory: src/frontend run: pnpm install @@ -30,11 +31,16 @@ jobs: working-directory: src/frontend run: pnpm run build + - name: Copy 404.html + working-directory: src/frontend + run: cp build/index.html build/404.html + - name: Deploy to GitHub Pages working-directory: src/frontend + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 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 }} + npx gh-pages -d build -u "github-actions[bot] " \ + --repo "https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git"