diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index bfc9f4d..6a2ea0b 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -10,18 +10,19 @@ on: name: pkgdown.yaml -permissions: read-all +permissions: + contents: read + pages: write + id-token: write 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 }} - permissions: - contents: write steps: - uses: actions/checkout@v4 @@ -40,10 +41,20 @@ jobs: run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) shell: Rscript {0} - - name: Deploy to GitHub pages 🚀 + - name: Upload Pages artifact if: github.event_name != 'pull_request' - uses: JamesIves/github-pages-deploy-action@v4.5.0 + uses: actions/upload-pages-artifact@v3 with: - clean: false - branch: gh-pages - folder: docs + path: docs + + deploy: + if: github.event_name != 'pull_request' + 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