From dccdc2982c109c3439345c0514252e4a016388ae Mon Sep 17 00:00:00 2001 From: 0b5vr <0b5vr@0b5vr.com> Date: Thu, 9 Nov 2023 23:29:34 +0900 Subject: [PATCH] ci: replace the gh-pages action from peaceiris' one to actions/deploy-pages Also simplify jobs considering `prepare` script --- .github/workflows/gh-pages.yaml | 52 +++++++++------------------------ 1 file changed, 13 insertions(+), 39 deletions(-) diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml index cd752dc..fc9c546 100644 --- a/.github/workflows/gh-pages.yaml +++ b/.github/workflows/gh-pages.yaml @@ -10,58 +10,32 @@ defaults: shell: bash jobs: - fetch: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: '16' - cache: 'yarn' - - name: Fetch Deps - run: yarn - build: runs-on: ubuntu-latest - needs: fetch steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: node-version: '16' cache: 'yarn' - - name: Fetch Deps + - name: Install + Prepare run: yarn - - name: Build - run: yarn build - name: Upload Builds - uses: actions/upload-artifact@v2 + uses: actions/upload-pages-artifact@v2 with: - name: build - path: | - dist/ + path: dist pages: runs-on: ubuntu-latest + if: ${{ github.ref == 'refs/heads/main' }} needs: - - build + - build + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} steps: - - uses: actions/checkout@v2 - - uses: actions/download-artifact@v2 - with: - path: artifacts - - name: Setup Pages - run: | - mkdir pages - - mv README.md pages - mv LICENSE.txt pages - mv package.json pages - mv index.html pages - - mv artifacts/build/* pages - - name: Publish gh-pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: pages + - name: Deploy to GitHub Pages + uses: actions/deploy-pages@v2