diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 259ebb3..8043250 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -3,6 +3,7 @@ on: workflow_dispatch: pull_request: + branches: [main, master] push: branches: [main, master] release: @@ -18,14 +19,19 @@ jobs: pkgdown: needs: prepare-ptaxsim 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 }} PTAXSIM_DB_PATH: ${{ github.workspace }}/ptaxsim.db + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} + cancel-in-progress: false permissions: - contents: write + contents: read + pages: write + id-token: write steps: - uses: actions/checkout@v3 @@ -57,10 +63,15 @@ jobs: run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) shell: Rscript {0} - - name: Deploy to GitHub pages 🚀 - if: github.event_name != 'pull_request' - uses: JamesIves/github-pages-deploy-action@v4.4.1 + - name: Configure pages + uses: actions/configure-pages@v3 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 with: - clean: false - branch: gh-pages - folder: docs + path: 'docs' + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 +