Skip to content

Commit 7e84ceb

Browse files
committed
update GHA
1 parent c38c096 commit 7e84ceb

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

.github/workflows/pkgdown.yaml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
on:
22
push:
3-
branches: master
3+
branches:
4+
- master
5+
- main
6+
pull_request:
7+
branches:
8+
- master
9+
- main
410

511
name: pkgdown
612

@@ -12,9 +18,12 @@ jobs:
1218
steps:
1319
- uses: actions/checkout@v2
1420

15-
- uses: r-lib/actions/setup-r@master
21+
- uses: r-lib/actions/setup-r@v1
1622

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
1827

1928
- name: Query dependencies
2029
run: |
@@ -24,22 +33,30 @@ jobs:
2433
shell: Rscript {0}
2534

2635
- name: Cache R packages
27-
uses: actions/cache@v1
36+
uses: actions/cache@v2
2837
with:
2938
path: ${{ env.R_LIBS_USER }}
3039
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
3140
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
3241

3342
- name: Install dependencies
3443
run: |
35-
install.packages("remotes")
3644
remotes::install_deps(dependencies = TRUE)
37-
remotes::install_dev("pkgdown")
45+
remotes::install_github("tidyverse/tidytemplate")
46+
install.packages("pkgdown", type = "binary")
3847
shell: Rscript {0}
3948

4049
- name: Install package
4150
run: R CMD INSTALL .
4251

52+
- name: Build site
53+
if: github.event_name == 'pull_request'
54+
run: |
55+
Rscript -e 'pkgdown::build_site()'
56+
4357
- 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

Comments
 (0)