From 1616821efc74aaadd183ce982f6494638dd36ba0 Mon Sep 17 00:00:00 2001 From: Mathieu Bastian Date: Tue, 7 Oct 2025 21:55:09 +0200 Subject: [PATCH] Update GH workflow to use new deploy pages action --- .github/workflows/build_website.yml | 56 +++++++++++++++++++---------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build_website.yml b/.github/workflows/build_website.yml index 06e6106..97064c1 100644 --- a/.github/workflows/build_website.yml +++ b/.github/workflows/build_website.yml @@ -8,30 +8,50 @@ on: # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on # Allows you to run this workflow manually from the Actions tab workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + jobs: deploy: name: Deploy to GitHub Pages runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v3 + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 22 cache: npm - - name: Configure Git - run: | - git config user.name "Publisher" - git config user.email "publisher@users.noreply.github.com" - - name: Build website - run: npm install + + - name: Install dependencies + run: npm ci + - name: Build website run: npm run build - - name: Switch to branch 'gh-pages' - run: | - git branch -f gh-pages HEAD - git checkout gh-pages - - run: | - cp CNAME build/CNAME - git add -f build/ - git commit -m "Publish" - git push -f origin `git subtree split -P build`:refs/heads/gh-pages + + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./build + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4