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
3- # Add Config/Needs/website: tidyverse/tidytemplate to DESCRIPTION
43on :
54 push :
65 branches : [main, master]
7- tags : ['*']
86 pull_request :
97 branches : [main, master]
8+ release :
9+ types : [published]
10+ workflow_dispatch :
1011
1112name : pkgdown
1213
1314jobs :
1415 pkgdown :
1516 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 }}
1620 env :
1721 GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
1822 steps :
2630
2731 - uses : r-lib/actions/setup-r-dependencies@v2
2832 with :
29- extra-packages : r-lib/ pkgdown
33+ extra-packages : any:: pkgdown, local::.
3034 needs : website
3135
32- - name : Install dev reticulate
33- run : pak::pkg_install('rstudio/reticulate')
34- shell : Rscript {0}
35-
3636 - name : Install Miniconda
3737 # conda can fail at downgrading python, so we specify python version in advance
3838 env :
@@ -45,17 +45,14 @@ jobs:
4545 tensorflow::install_tensorflow(version='2.7', conda_python_version = NULL)
4646 shell : Rscript {0}
4747
48- - name : Install package
49- run : R CMD INSTALL .
50-
5148 - name : Build site
52- if : github.event_name == 'pull_request'
53- run : |
54- Rscript -e 'pkgdown::build_site()'
49+ run : pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
50+ shell : Rscript {0}
5551
56- - name : Deploy package
57- if : github.event_name == 'push'
58- run : |
59- git config --local user.name "$GITHUB_ACTOR"
60- git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
61- Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
52+ - name : Deploy to GitHub pages 🚀
53+ if : github.event_name != 'pull_request'
54+ uses : JamesIves/github-pages-deploy-action@4.1.4
55+ with :
56+ clean : false
57+ branch : gh-pages
58+ folder : docs
0 commit comments