From 6cc95a7159f2a0504921edf56de9789c9cb0ccbd Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Thu, 19 Dec 2024 13:18:45 +0800 Subject: [PATCH] feat: use GHA to deploy pages (#75) --- .github/workflows/deploy.yml | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d7e08013..23a5175f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,8 +5,7 @@ on: branches: [main] jobs: - deploy: - name: Deploy to GitHub Pages + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -18,11 +17,21 @@ jobs: run: | yarn install --frozen-lockfile yarn build - # Popular action to deploy to GitHub Pages: - # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + - name: Upload static files as artifact + id: deployment + uses: actions/upload-pages-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - # Build output to publish to the `gh-pages` branch: - publish_dir: ./build \ No newline at end of file + path: ./build + release: + runs-on: ubuntu-latest + permissions: + id-token: write + pages: write + needs: build + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file