From 1980fca79cf4960fa0d4b9584d55901d1b723410 Mon Sep 17 00:00:00 2001 From: Christopher Prener Date: Sat, 30 May 2026 23:37:31 -0700 Subject: [PATCH] fix: switch GitHub Pages deploy to first-party actions Replace JamesIves/github-pages-deploy-action@v4 with GitHub's official actions/upload-pages-artifact@v3 + actions/deploy-pages@v4. This eliminates the 403 permission error by deploying via the Pages API with OIDC instead of git-pushing to the gh-pages branch. - Add permissions: contents read, pages write, id-token write - Split into build + deploy jobs (required by deploy-pages) - Add github-pages environment with URL output - Replace concurrency group to match Pages convention Closes #78 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/pkgdown.yml | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pkgdown.yml b/.github/workflows/pkgdown.yml index 992d69d..23e531f 100644 --- a/.github/workflows/pkgdown.yml +++ b/.github/workflows/pkgdown.yml @@ -5,12 +5,18 @@ on: name: pkgdown +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: true + jobs: - pkgdown: + build: runs-on: ubuntu-latest - # Only restrict concurrency for non-PR jobs - concurrency: - group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: @@ -32,10 +38,18 @@ jobs: run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE, dest_dir = "_site") shell: Rscript {0} - - name: Deploy to GitHub pages 🚀 - if: github.event_name != 'pull_request' - uses: JamesIves/github-pages-deploy-action@v4 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 with: - clean: false - branch: gh-pages - folder: _site + path: _site + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages 🚀 + id: deployment + uses: actions/deploy-pages@v4