From 5f05ad7adba2257748151fa6ffce8901182552d2 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Wed, 3 Apr 2024 12:48:11 +0200 Subject: [PATCH] Update github page to new actions --- .github/workflows/page.yml | 42 +++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/.github/workflows/page.yml b/.github/workflows/page.yml index 71066d1..f095e60 100644 --- a/.github/workflows/page.yml +++ b/.github/workflows/page.yml @@ -1,22 +1,32 @@ -name: GitHub Pages +name: Deploy on: push: branches: - master + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write jobs: - build-deploy: + build: runs-on: ubuntu-latest concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: - submodules: true + submodules: recursive fetch-depth: 0 + - name: Setup Pages + id: pages + uses: actions/configure-pages@v4 + - name: Setup Hugo uses: peaceiris/actions-hugo@v2 with: @@ -24,12 +34,20 @@ jobs: extended: true - name: Build - run: hugo --minify + run: hugo --gc --minify - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - if: ${{ github.ref == 'refs/heads/master' }} + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_branch: gh-pages - publish_dir: ./public + path: ./public + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4