Skip to content

Commit 3c65771

Browse files
Merge pull request #209 from dhersz/master
changes pkgdown action
2 parents ba0d29d + f2dfbf2 commit 3c65771

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

.github/workflows/pkgdown.yaml

+27-14
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,59 @@ on:
22
push:
33
branches:
44
- master
5+
tags:
6+
-'*'
57

68
name: pkgdown
79

810
jobs:
911
pkgdown:
10-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-18.04
1113
env:
14+
RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest
1215
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16+
1317
steps:
1418
- uses: actions/checkout@v2
1519

1620
- uses: r-lib/actions/setup-r@v1
21+
id: install-r
1722

1823
- uses: r-lib/actions/setup-pandoc@v1
1924

20-
- name: Query dependencies
25+
- name: Install pak and query dependencies
2126
run: |
22-
install.packages('remotes')
23-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
24-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
27+
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
28+
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
2529
shell: Rscript {0}
2630

27-
- name: Cache R packages
31+
- name: Restore R package cache
2832
uses: actions/cache@v2
2933
with:
30-
path: ${{ env.R_LIBS_USER }}
31-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
32-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
34+
path: |
35+
${{ env.R_LIBS_USER }}/*
36+
!${{ env.R_LIBS_USER }}/pak
37+
key: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
38+
restore-keys: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-
39+
40+
- name: Install system dependencies
41+
if: runner.os == 'Linux'
42+
run: |
43+
pak::local_system_requirements(execute = TRUE)
44+
pak::pkg_system_requirements("pkgdown", execute = TRUE)
45+
shell: Rscript {0}
3346

3447
- name: Install dependencies
3548
run: |
36-
remotes::install_deps(dependencies = TRUE)
37-
install.packages("pkgdown", type = "binary")
49+
pak::local_install_dev_deps(upgrade = TRUE)
50+
pak::pkg_install("pkgdown")
3851
shell: Rscript {0}
3952

4053
- name: Install package
4154
run: R CMD INSTALL .
4255

43-
- name: Deploy package
56+
- name: Build and deploy pkgdown site
4457
run: |
45-
git config --local user.email "[email protected]"
46-
git config --local user.name "GitHub Actions"
58+
git config --local user.name "$GITHUB_ACTOR"
59+
git config --local user.email "[email protected]"
4760
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'

0 commit comments

Comments
 (0)