Update build action

This commit is contained in:
Hadley Wickham 2022-01-03 15:28:15 -06:00
parent 1deb5f6e3a
commit 51a406bafd
1 changed files with 9 additions and 31 deletions

View File

@ -1,10 +1,9 @@
on:
push:
branches:
- main
branches: [main, master]
pull_request:
branches:
- main
branches: [main, master]
workflow_dispatch:
schedule:
# run every day at 11 PM
- cron: '0 23 * * *'
@ -16,40 +15,19 @@ env:
jobs:
build:
runs-on: macOS-latest
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
- uses: actions/checkout@v2
- name: Setup R
uses: r-lib/actions/setup-r@master
- uses: r-lib/actions/setup-pandoc@v2
- name: Setup pandoc
uses: r-lib/actions/setup-pandoc@master
- name: Get R version
id: get-r-version
run: |
echo "::set-output name=version::$(Rscript -e 'cat(as.character(getRversion()))')"
shell: bash
- name: Cache R packages
uses: actions/cache@v2
- uses: r-lib/actions/setup-r@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ steps.get-r-version.outputs.version }}-3-
use-public-rspm: true
- name: Install pak
run: |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
shell: Rscript {0}
- name: Install dependencies
run: |
pak::local_install_dev_deps()
shell: Rscript {0}
- uses: r-lib/actions/setup-r-dependencies@v2
- name: Cache bookdown results
uses: actions/cache@v2