Skip to content

Merge branch 'main' of github.com:egap/theory_and_practice_of_field_e… #55

Merge branch 'main' of github.com:egap/theory_and_practice_of_field_e…

Merge branch 'main' of github.com:egap/theory_and_practice_of_field_e… #55

Workflow file for this run

name: Build and Deploy
on: ["push", "pull_request"]
jobs:
build_job:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: 'main'
persist-credentials: false
- name: Install Ubuntu Packages
run: |
sudo apt-get update
sudo apt-get install --fix-missing
sudo apt-get install -y libcurl4-openssl-dev pandoc pandoc-citeproc texlive texlive-xetex biber libicu-dev
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: '4.4.1'
- name: Install renv from github
run: Rscript -e 'install.packages("renv")'
- uses: actions/cache@v3
with:
path: ~/.local/share/renv
key: ${{ runner.os }}-renv-v1-${{ hashFiles('**/renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-v1-
- name: Install packages
working-directory: Book
run: Rscript -e 'renv::restore()'
- name: Run bookdown for html and epub
run: |
Rscript -e "bookdown::render_book('index.Rmd', 'bookdown::gitbook')"
Rscript -e "bookdown::render_book('index.Rmd', 'bookdown::epub_book')"
working-directory: Book
- name: Run bookdown to make pdf
run: |
Rscript -e "bookdown::render_book('index.Rmd', 'bookdown::pdf_book')"
working-directory: Book
- name: Push to gh-pages
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: Book/_book