update actions yml to use docker and cacheing #3
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
name: Build Documentation | |
on: | |
push: | |
branches: | |
- main | |
- test-github-actions | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: | |
image: rocker/verse:latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Add cache for R packages | |
- name: Cache R packages | |
uses: actions/cache@v3 | |
with: | |
path: /usr/local/lib/R/site-library | |
key: ${{ runner.os }}-r-${{ hashFiles('**/DESCRIPTION') }} | |
restore-keys: | | |
${{ runner.os }}-r- | |
# Add cache for APT packages | |
- name: Cache APT packages | |
uses: actions/cache@v3 | |
with: | |
path: /var/cache/apt/archives | |
key: ${{ runner.os }}-apt-${{ hashFiles('**/build-docs.yml') }} | |
- name: Install LaTeX | |
run: | | |
apt-get update | |
apt-get install -y texlive-latex-base texlive-latex-extra texlive-fonts-recommended texlive-xetex | |
- name: Install R packages | |
run: | | |
Rscript -e 'install.packages(c("rmarkdown", "tools", "utils"))' | |
- name: Run Makefile | |
working-directory: assignments | |
run: | | |
make all | |