From 70585878ed6edf93d2ba05b75d17d4e565ce0a8e Mon Sep 17 00:00:00 2001 From: Kai Hudalla Date: Fri, 18 Oct 2024 09:40:10 +0200 Subject: [PATCH] Use standard GitHub Pages action for publishing site --- .github/workflows/gh-pages.yaml | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml index c0fbf7f..721f8b4 100644 --- a/.github/workflows/gh-pages.yaml +++ b/.github/workflows/gh-pages.yaml @@ -5,10 +5,11 @@ on: branches: - main # Set a branch to deploy pull_request: + workflow_dispatch: jobs: - deploy: - runs-on: ubuntu-22.04 + build: + runs-on: ubuntu-latest concurrency: group: ${{ github.workflow }}-${{ github.ref }} steps: @@ -26,9 +27,25 @@ jobs: - name: Build run: hugo --minify - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - if: github.ref == 'refs/heads/main' + - name: Upload static files as artifact + id: deployment + uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./public + path: ./public + + # Deployment job + deploy: + if: github.ref == 'refs/heads/main' + # 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 + runs-on: ubuntu-latest + 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