From d7c1c92337246c812cf216914fcaebf9b96362f2 Mon Sep 17 00:00:00 2001 From: Viren070 Date: Sat, 12 Oct 2024 14:58:48 +0100 Subject: [PATCH] ci: use gh-pages --- .github/workflows/build.yml | 38 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fea1b95..b4797c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: Build and Deploy to GitHub Pages on: push: branches: - - main + - "**" # Trigger on all branches # Review gh actions docs if you want to further define triggers, paths, etc # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on @@ -24,28 +24,16 @@ jobs: run: npm ci - name: Build website run: npm run build - - - name: Upload Build Artifact - uses: actions/upload-pages-artifact@v3 - with: - path: build - - deploy: - name: Deploy to GitHub Pages - needs: build - - # Grant GITHUB_TOKEN the permissions required to make a Pages deployment - permissions: - pages: write # to deploy to Pages - id-token: write # to verify the deployment originates from an appropriate source - - # Deploy to the github-pages environment - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - runs-on: ubuntu-latest - steps: + + - name: Create build directory + run: mkdir -p ./build/${{ github.head_ref || github.ref_name }} + - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + if: github.actor != 'dependabot[bot]' + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build + destination_dir: ${{ github.head_ref || github.ref_name }} + allow_empty_commit: true +