Skip to content

Commit ce24784

Browse files
committed
Update pkgdown workflow
1 parent 8aa1f38 commit ce24784

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

.github/workflows/pkgdown.yaml

Lines changed: 20 additions & 5 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,7 +33,7 @@ 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') }}
@@ -36,13 +45,19 @@ jobs:
3645
remotes::install_github("tidyverse/tidytemplate")
3746
remotes::install_cran("tidymodels")
3847
remotes::install_cran("C50")
39-
install.packages("pkgdown")
48+
install.packages("pkgdown", type = "binary")
4049
shell: Rscript {0}
4150

4251
- name: Install package
4352
run: R CMD INSTALL .
4453

54+
- name: Build site
55+
if: github.event_name == 'pull_request'
56+
run: |
57+
Rscript -e 'pkgdown::build_site()'
58+
4559
- name: Deploy package
60+
if: github.event_name == 'push'
4661
run: |
4762
git config --local user.email "[email protected]"
4863
git config --local user.name "GitHub Actions"

0 commit comments

Comments
 (0)