From 11cd1caeff9e2e1db91e39e7e4832d400bd58108 Mon Sep 17 00:00:00 2001 From: sugar Date: Sun, 21 Jan 2024 14:46:40 +0800 Subject: [PATCH] chore: Update GitHub Actions workflow configuration --- .github/workflows/client.yml | 48 ++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/.github/workflows/client.yml b/.github/workflows/client.yml index 395ee11..83292fb 100644 --- a/.github/workflows/client.yml +++ b/.github/workflows/client.yml @@ -8,6 +8,21 @@ on: branches: [ "master" ] pull_request: branches: [ "master" ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false jobs: build: @@ -43,11 +58,30 @@ jobs: echo ${{ github.workspace }} cd ./packages/client pnpm build:github - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./packages/client/dist # 文档打包产物的目录名就是build - user_name: 'github-actions[bot]' - user_email: 'github-actions[bot]@users.noreply.github.com' - commit_message: ${{ github.event.head_commit.message }}` \ No newline at end of file + source: ./packages/client/dist + destination: ./_site + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + + # - name: Deploy to GitHub Pages + # uses: peaceiris/actions-gh-pages@v3 + # with: + # github_token: ${{ secrets.GITHUB_TOKEN }} + # publish_dir: ./packages/client/dist # 文档打包产物的目录名就是build + # user_name: 'github-actions[bot]' + # user_email: 'github-actions[bot]@users.noreply.github.com' + # commit_message: ${{ github.event.head_commit.message }}` + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file