render-xaringan #12
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
on: | |
push: | |
branches: | |
- main | |
- master | |
workflow_dispatch: | |
name: render-xaringan | |
jobs: | |
render-xaringan: | |
runs-on: macOS-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: r-lib/actions/setup-r@v2 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: Restore R package cache | |
uses: actions/cache@v4 | |
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- | |
- name: Install dependencies | |
run: | | |
install.packages('remotes') | |
remotes::install_cran(c("xaringan", "knitr", "rmarkdown", "tidyverse", "DT", "leaflet", "mapSpain"), dependencies = TRUE, type="binary") | |
shell: Rscript {0} | |
- name: Render | |
run: | | |
rmarkdown::render('index.Rmd') | |
shell: Rscript {0} | |
- name: Commit results | |
run: | | |
git config --local user.name "github-actions[bot]" | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add -A | |
git commit -m 'Update xaringan' || echo "No changes to commit" | |
git push origin || echo "No changes to commit" |