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
2
2
# 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
4
3
on :
5
4
push :
6
5
branches : [main, master]
7
- tags : ['*']
8
6
pull_request :
9
7
branches : [main, master]
8
+ release :
9
+ types : [published]
10
+ workflow_dispatch :
10
11
11
12
name : pkgdown
12
13
13
14
jobs :
14
15
pkgdown :
15
16
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 }}
16
20
env :
17
21
GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
18
22
steps :
26
30
27
31
- uses : r-lib/actions/setup-r-dependencies@v2
28
32
with :
29
- extra-packages : r-lib/ pkgdown
33
+ extra-packages : any:: pkgdown, local::.
30
34
needs : website
31
35
32
- - name : Install dev reticulate
33
- run : pak::pkg_install('rstudio/reticulate')
34
- shell : Rscript {0}
35
-
36
36
- name : Install Miniconda
37
37
# conda can fail at downgrading python, so we specify python version in advance
38
38
env :
@@ -45,17 +45,14 @@ jobs:
45
45
tensorflow::install_tensorflow(version='2.7', conda_python_version = NULL)
46
46
shell : Rscript {0}
47
47
48
- - name : Install package
49
- run : R CMD INSTALL .
50
-
51
48
- 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}
55
51
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