Skip to content

Small fixes

Small fixes #115

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
env:
RENV_PATHS_ROOT: ~/.local/share/renv
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: '4.2.3' # The R version to download (if necessary) and use.
- name: Install libcurl and v8
run: sudo apt-get install libcurl4-openssl-dev libv8-dev calibre librsvg2-dev pandoc pandoc-citeproc curl
- name: Cache Renv packages
uses: actions/cache@v2
with:
path: ${{ env.RENV_PATHS_ROOT }}
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-
- name: Cache bookdown results
uses: actions/cache@v2
with:
path: _bookdown_files
key: bookdown-${{ hashFiles('**/*Rmd') }}
restore-keys: bookdown-
- name: Install packages
run: |
R -e 'install.packages("renv")'
R -e 'renv::restore()'
- name: Install tinytex
run: |
R -e 'install.packages("tinytex")'
R -e 'tinytex::install_tinytex()'
- name: Build the book
run: |
R -e "source('contribs.R')"
R -e "source('./diagrams/diagrams.R')"
R -e "bookdown::render_book('index.Rmd')"
R -e "bookdown::render_book('index.Rmd', 'bookdown::pdf_book')"
R -e "bookdown::render_book('index.Rmd', 'bookdown::epub_book')"
R -e "bookdown::calibre('docs/teacheR.epub', 'docs/teacheR.mobi')"
# Deploys the files to GitHubPages
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs # The folder the action should deploy.
CLEAN: FALSE # Automatically remove deleted files from the deploy branch