Skip to content

Commit

Permalink
Try caching pkgs
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace committed Sep 24, 2024
1 parent 63c4868 commit 7a46538
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/main-no-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
on:
pull_request:
branches:
- main
name: Render-no-deploy
name: Render Book

on: [push, pull_request]

jobs:
bookdown:
name: Render-Book
build:
runs-on: ubuntu-latest
container: geocompr/geocompr:suggests

steps:
- uses: actions/checkout@v2
- name: Render Book

- name: Cache R packages
uses: actions/cache@v2
with:
path: ~/.R
key: ${{ runner.os }}-R-${{ hashFiles('**/*.Rmd') }}
restore-keys: |
${{ runner.os }}-R-
- name: Install Dependencies
run: |
Rscript -e 'install.packages("geocompkg", repos = c("https://geocompr.r-universe.dev", "https://cloud.r-project.org"), dependencies = TRUE, force = TRUE)'
Rscript -e 'bookdown::render_book("index.Rmd")'
- name: Render Book
run: |
Rscript -e 'bookdown::render_book("index.Rmd")'

0 comments on commit 7a46538

Please sign in to comment.