From 98338fd9c1aa70ef31ed2091e7528179ebc9cdf1 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Sun, 18 Aug 2024 21:45:59 +0800 Subject: [PATCH] refactor: use actions/deploy-pages --- .github/workflows/build.yml | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 22f777a..7f2ddfb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,21 +57,19 @@ jobs: if: github.event_name == 'push' runs-on: ubuntu-latest needs: [build] - timeout-minutes: 15 + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} steps: - - uses: actions/download-artifact@v3 - with: - name: dist - path: ${{ github.workspace }}/out/ - - - run: ls -R ${{ github.workspace }}/out/ - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + id: deployment + uses: actions/deploy-pages@v4 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: out - cname: baoshuo.ren - user_name: BaoshuoBot - user_email: bot@baoshuo.dev + artifact_name: dist + ## Is this attempting to deploy a pull request as a GitHub Pages preview site? + ## NOTE: This feature is only in alpha currently and is not available to the public! + # preview: ${{ github.event_name != 'push' }}