fix: correct r version #160
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: | |
- master | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
name: renderbook | |
jobs: | |
bookdown: | |
name: Render-Book | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v1 | |
with: | |
path: ~/.local/share/renv | |
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }} | |
restore-keys: | | |
${{ runner.os }}-renv- | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
crayon.enabled: 'FALSE' | |
r-version: '4.1.0' | |
Ncpus: 4 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
# - uses: r-lib/actions/setup-renv@v2 | |
- name: Install tinytex | |
uses: r-lib/actions/setup-tinytex@v2 | |
- name: Install sysreq | |
run: sudo apt update && sudo apt install -y gdal-bin git-core libcairo2-dev libgdal-dev libgeos-dev libgeos++-dev libgit2-dev libpng-dev libssh2-1-dev libssl-dev libudunits2-dev libxml2-dev make pandoc pandoc-citeproc zlib1g-dev libmagick++-dev libssl-dev libsasl2-dev | |
- name: Pulling hexmake | |
run: docker pull colinfay/hexmake | |
- uses: nanasess/setup-chromedriver@master | |
- name: Install rmarkdown, bookdown and sysfonts | |
run: Rscript -e 'install.packages(c("sysfonts", "rmarkdown","bookdown"), Ncpus = 4)' | |
- name: Spell check | |
run: Rscript before-build-spellcheck.R | |
env: | |
EMAIL: ${{ secrets.EMAIL }} | |
GH_TOKEN: ${{ secrets.TOKEN }} | |
- name: Before build | |
run: Rscript prep.R | |
- name: Render Book | |
run: Rscript -e 'bookdown::render_book("index.Rmd")' | |
- name: Build redirect | |
run: Rscript redirect.R | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: _site | |
path: _site/ | |
# Need to first create an empty gh-pages branch | |
# see https://pkgdown.r-lib.org/reference/deploy_site_github.html | |
# and also add secrets for a GITHUB_PAT and EMAIL to the repository | |
# gh-action from Cecilapp/GitHub-Pages-deploy | |
checkout-and-deploy: | |
runs-on: ubuntu-latest | |
needs: bookdown | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Download artifact | |
uses: actions/download-artifact@v1.0.0 | |
with: | |
# Artifact name | |
name: _site # optional | |
# Destination path | |
path: _site # optional | |
- name: Deploy to GitHub Pages | |
uses: Cecilapp/GitHub-Pages-deploy@v3 | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} | |
with: | |
email: ${{ secrets.EMAIL }} | |
build_dir: _site # optional | |
cname: engineering-shiny.org # optional | |
jekyll: no # optional | |