Skip to content

Commit b4bc293

Browse files
Update pkgdown GitHub Action (#4151)
* Update pkgdown GitHub Action * Include release event * Fix a typo * Install tidytemplate
1 parent 8f7b03c commit b4bc293

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

.github/workflows/pkgdown.yaml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,41 @@ name: pkgdown
1010
jobs:
1111
pkgdown:
1212
runs-on: macOS-latest
13+
env:
14+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1315
steps:
1416
- uses: actions/checkout@v2
17+
1518
- uses: r-lib/actions/setup-r@master
19+
1620
- uses: r-lib/actions/setup-pandoc@master
21+
22+
- name: Query dependencies
23+
run: |
24+
install.packages('remotes')
25+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
26+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
27+
shell: Rscript {0}
28+
29+
- name: Cache R packages
30+
uses: actions/cache@v1
31+
with:
32+
path: ${{ env.R_LIBS_USER }}
33+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
34+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
35+
1736
- name: Install dependencies
1837
run: |
19-
install.packages("remotes")
2038
remotes::install_deps(dependencies = TRUE, type = "binary")
2139
remotes::install_github("tidyverse/tidytemplate")
2240
remotes::install_dev("pkgdown")
2341
shell: Rscript {0}
42+
2443
- name: Install package
2544
run: R CMD INSTALL .
45+
2646
- name: Deploy package
27-
run: pkgdown::deploy_to_branch(new_process = FALSE)
28-
shell: Rscript {0}
47+
run: |
48+
git config --local user.email "actions@github.com"
49+
git config --local user.name "GitHub Actions"
50+
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'

0 commit comments

Comments
 (0)