Merge pull request #37 from GBisi/patch-3 #113
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: Deploy book | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'README.md' | |
jobs: | |
bookdown: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Cache Yarn packages | |
uses: actions/cache@v2 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install libcurl4-openssl-dev imagemagick libmagick++-dev libpoppler-cpp-dev | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
- name: Cache R packages | |
uses: actions/cache@v2 | |
id: cache-r-packages | |
with: | |
path: ${{ env.R_LIBS_USER }} | |
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }} | |
restore-keys: | | |
${{ runner.os }}-renv- | |
- name: Setup Pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
- name: Setup TinyTeX | |
uses: r-lib/actions/setup-tinytex@v2 | |
- name: Install R packages | |
if: steps.cache-r-packages.outputs.cache-hit != 'true' | |
run: | | |
R -e "install.packages('bookdown')" | |
R -e "install.packages('magick')" | |
R -e "install.packages('pdftools')" | |
- name: Build site | |
run: | | |
./build_book | |
- name: Deploy to build branch | |
uses: JamesIves/github-pages-deploy-action@3.6.2 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: build | |
FOLDER: book |