Skip to content

Commit

Permalink
Update build script (#591)
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley authored Nov 3, 2022
1 parent 4ab1b60 commit 5d398fd
Showing 1 changed file with 6 additions and 27 deletions.
33 changes: 6 additions & 27 deletions .github/workflows/build-book.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,17 @@ jobs:
build:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
runs-on: macOS-latest
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@master
- uses: actions/checkout@v3

- name: Setup R
id: install-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: Install pak and query dependencies
run: |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
saveRDS(pak::local_dev_deps_tree(), ".github/r-depends.rds")
shell: Rscript {0}

- 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.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
restore-keys: ${{ runner.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-

- name: Install dependencies
run: |
pak::local_install_dev_deps(upgrade = TRUE)
shell: Rscript {0}
use-public-rspm: true

- name: Install PhantomJS
run: R -e 'webshot::install_phantomjs()'
- uses: r-lib/actions/setup-r-dependencies@v2

- name: Build book
run: Rscript -e 'bookdown::render_book("index.Rmd", quiet = TRUE)'
Expand Down

0 comments on commit 5d398fd

Please sign in to comment.