forked from r-lib/usethis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the pak based actions for tidy github actions (r-lib#1346)
* Use the pak based actions for tidy github actions * Update usethis workflows * Re-arrange username and user-email * Set the R-devel CI user agent to R 4.0 Because we want RSPM to serve the R 4.0 binaries for R-devel. * Whitespace Co-authored-by: Jenny Bryan <[email protected]>
- Loading branch information
Showing
4 changed files
with
49 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,46 +8,49 @@ name: pkgdown | |
|
||
jobs: | ||
pkgdown: | ||
runs-on: macOS-latest | ||
runs-on: ubuntu-18.04 | ||
env: | ||
RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: r-lib/actions/setup-r@v1 | ||
id: install-r | ||
|
||
- uses: r-lib/actions/setup-pandoc@v1 | ||
|
||
- name: Query dependencies | ||
- name: Install pak and query dependencies | ||
run: | | ||
install.packages('remotes') | ||
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) | ||
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") | ||
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") | ||
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds") | ||
shell: Rscript {0} | ||
|
||
- name: Cache R packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.R_LIBS_USER }} | ||
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} | ||
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- | ||
key: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }} | ||
restore-keys: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1- | ||
|
||
- name: Install macOS system dependencies | ||
if: runner.os == 'macOS' | ||
- name: Install system dependencies | ||
if: runner.os == 'Linux' | ||
run: | | ||
brew install libgit2 | ||
brew install imagemagick@6 | ||
pak::local_system_requirements(execute = TRUE) | ||
pak::pkg_system_requirements("pkgdown", execute = TRUE) | ||
shell: Rscript {0} | ||
|
||
- name: Install dependencies | ||
run: | | ||
remotes::install_deps(dependencies = TRUE) | ||
install.packages("pkgdown", type = "binary") | ||
pak::local_install_dev_deps(upgrade = TRUE) | ||
pak::pkg_install("pkgdown") | ||
shell: Rscript {0} | ||
|
||
- name: Install package | ||
run: R CMD INSTALL . | ||
|
||
- name: Deploy package | ||
- name: Build and deploy pkgdown site | ||
run: | | ||
git config --local user.name "$GITHUB_ACTOR" | ||
git config --local user.email "[email protected]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters