From 0cd6d5824b8e6fe8ca95862a67738707403d8b3b Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sun, 15 Jun 2025 12:25:40 +0100 Subject: [PATCH] Update action --- .github/workflows/gh-pages.yml | 39 +++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index e649a88..6ce5765 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -6,8 +6,20 @@ on: - main 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: + build: runs-on: ubuntu-latest permissions: contents: write @@ -22,15 +34,18 @@ jobs: cp -R pkg/reconcile.js examples/website/ cp -R pkg/reconcile_bg.wasm examples/website/ - - name: Copy website files to output - run: | - mkdir public - cp examples/website/* public/ - - - name: Deploy to GitHub Pages - uses: actions/gh-pages@v4 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./public - publish_branch: gh-pages - force_orphan: true + path: examples/website + + 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