1
1
on :
2
2
push :
3
- branches : master
3
+ branches :
4
+ - master
5
+ - main
6
+ pull_request :
7
+ branches :
8
+ - master
9
+ - main
4
10
5
11
name : pkgdown
6
12
12
18
steps :
13
19
- uses : actions/checkout@v2
14
20
15
- - uses : r-lib/actions/setup-r@master
21
+ - uses : r-lib/actions/setup-r@v1
16
22
17
- - uses : r-lib/actions/setup-pandoc@master
23
+ - uses : r-lib/actions/setup-pandoc@v1
24
+
25
+ - name : System dependencies
26
+ run : brew install harfbuzz fribidi
18
27
19
28
- name : Query dependencies
20
29
run : |
@@ -24,22 +33,30 @@ jobs:
24
33
shell : Rscript {0}
25
34
26
35
- name : Cache R packages
27
- uses : actions/cache@v1
36
+ uses : actions/cache@v2
28
37
with :
29
38
path : ${{ env.R_LIBS_USER }}
30
39
key : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
31
40
restore-keys : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
32
41
33
42
- name : Install dependencies
34
43
run : |
35
- install.packages("remotes")
36
44
remotes::install_deps(dependencies = TRUE)
37
- remotes::install_dev("pkgdown")
45
+ remotes::install_github("tidyverse/tidytemplate")
46
+ install.packages("pkgdown", type = "binary")
38
47
shell : Rscript {0}
39
48
40
49
- name : Install package
41
50
run : R CMD INSTALL .
42
51
52
+ - name : Build site
53
+ if : github.event_name == 'pull_request'
54
+ run : |
55
+ Rscript -e 'pkgdown::build_site()'
56
+
43
57
- name : Deploy package
44
- run : pkgdown::deploy_to_branch(new_process = FALSE)
45
- shell : Rscript {0}
58
+ if : github.event_name == 'push'
59
+ run : |
60
+ git config --local user.email "[email protected] "
61
+ git config --local user.name "GitHub Actions"
62
+ Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
0 commit comments