1- # Workflow derived from https://github.com/r-lib/actions/tree/master /examples
1+ # Workflow derived from https://github.com/r-lib/actions/tree/v2 /examples
22# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33on :
44 push :
55 branches : [main, master]
6+ pull_request :
7+ branches : [main, master]
68 release :
79 types : [published]
810 workflow_dispatch :
@@ -12,10 +14,13 @@ name: pkgdown
1214jobs :
1315 pkgdown :
1416 runs-on : ubuntu-latest
17+ # Only restrict concurrency for non-PR jobs
18+ concurrency :
19+ group : pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
1520 env :
1621 GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
1722 steps :
18- - uses : actions/checkout@v2
23+ - uses : actions/checkout@v3
1924
2025 - uses : r-lib/actions/setup-pandoc@v2
2126
@@ -25,11 +30,17 @@ jobs:
2530
2631 - uses : r-lib/actions/setup-r-dependencies@v2
2732 with :
28- extra-packages : pkgdown
33+ extra-packages : any:: pkgdown, local::.
2934 needs : website
3035
31- - name : Deploy package
32- run : |
33- git config --local user.name "$GITHUB_ACTOR"
34- git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
35- Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
36+ - name : Build site
37+ run : pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
38+ shell : Rscript {0}
39+
40+ - name : Deploy to GitHub pages 🚀
41+ if : github.event_name != 'pull_request'
42+ uses : JamesIves/github-pages-deploy-action@v4.4.1
43+ with :
44+ clean : false
45+ branch : gh-pages
46+ folder : docs
0 commit comments