1+ # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+ # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
13on :
24 push :
3- branches :
4- - main
5- - master
5+ branches : [main, master]
6+ pull_request :
7+ release :
8+ types : [published]
9+ workflow_dispatch :
610
7- name : pkgdown
11+ name : pkgdown.yaml
12+
13+ permissions : read-all
814
915jobs :
1016 pkgdown :
11- runs-on : macOS-latest
17+ runs-on : ubuntu-latest
18+ # Only restrict concurrency for non-PR jobs
19+ concurrency :
20+ group : pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
1221 env :
1322 GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
23+ permissions :
24+ contents : write
1425 steps :
15- - uses : actions/checkout@v2
16-
17- - uses : r-lib/actions/setup-r@v1
26+ - uses : actions/checkout@v4
1827
19- - uses : r-lib/actions/setup-pandoc@v1
28+ - uses : r-lib/actions/setup-pandoc@v2
2029
21- - name : Query dependencies
22- run : |
23- install.packages('remotes')
24- saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
25- writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
26- shell : Rscript {0}
30+ - uses : r-lib/actions/setup-r@v2
31+ with :
32+ use-public-rspm : true
2733
28- - name : Cache R packages
29- uses : actions/cache@v2
34+ - uses : r-lib/actions/setup-r-dependencies@v2
3035 with :
31- path : ${{ env.R_LIBS_USER }}
32- key : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
33- restore-keys : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
34-
35- - name : Install dependencies
36- run : |
37- remotes::install_deps(dependencies = TRUE)
38- install.packages("pkgdown", type = "binary")
39- shell : Rscript {0}
36+ extra-packages : any::pkgdown, local::.
37+ needs : website
4038
41- - name : Install package
42- run : R CMD INSTALL .
39+ - name : Build site
40+ run : pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
41+ shell : Rscript {0}
4342
44- - name : Deploy package
45- run : |
46- git config --local user.email "[email protected] " 47- git config --local user.name "GitHub Actions"
48- Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
43+ - name : Deploy to GitHub pages 🚀
44+ if : github.event_name != 'pull_request'
45+ 46+ with :
47+ clean : false
48+ branch : gh-pages
49+ folder : docs
0 commit comments