|
2 | 2 | push:
|
3 | 3 | branches:
|
4 | 4 | - master
|
| 5 | + tags: |
| 6 | + -'*' |
5 | 7 |
|
6 | 8 | name: pkgdown
|
7 | 9 |
|
8 | 10 | jobs:
|
9 | 11 | pkgdown:
|
10 |
| - runs-on: ubuntu-20.04 |
| 12 | + runs-on: ubuntu-18.04 |
11 | 13 | env:
|
| 14 | + RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest |
12 | 15 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
|
| 16 | + |
13 | 17 | steps:
|
14 | 18 | - uses: actions/checkout@v2
|
15 | 19 |
|
16 | 20 | - uses: r-lib/actions/setup-r@v1
|
| 21 | + id: install-r |
17 | 22 |
|
18 | 23 | - uses: r-lib/actions/setup-pandoc@v1
|
19 | 24 |
|
20 |
| - - name: Query dependencies |
| 25 | + - name: Install pak and query dependencies |
21 | 26 | 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") |
25 | 29 | shell: Rscript {0}
|
26 | 30 |
|
27 |
| - - name: Cache R packages |
| 31 | + - name: Restore R package cache |
28 | 32 | uses: actions/cache@v2
|
29 | 33 | 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} |
33 | 46 |
|
34 | 47 | - name: Install dependencies
|
35 | 48 | 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") |
38 | 51 | shell: Rscript {0}
|
39 | 52 |
|
40 | 53 | - name: Install package
|
41 | 54 | run: R CMD INSTALL .
|
42 | 55 |
|
43 |
| - - name: Deploy package |
| 56 | + - name: Build and deploy pkgdown site |
44 | 57 | 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]" |
47 | 60 | Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
|
0 commit comments