Cambiar a nuevo pipe #25
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: main | |
pull_request: | |
branches: main | |
# to be able to trigger a manual build | |
workflow_dispatch: | |
env: | |
RENV_PATHS_ROOT: ~/renv | |
permissions: | |
contents: write | |
name: Render and deploy Book | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: cmdstan env vars | |
run: | | |
echo "CMDSTAN_PATH=${HOME}/.cmdstan" >> $GITHUB_ENV | |
shell: bash | |
- uses: actions/checkout@v3 | |
- name: update | |
run: sudo apt-get update | |
- name: Install curl | |
run: sudo apt-get install -y libcurl4-openssl-dev | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get dist-upgrade -y | |
sudo apt-get install -y \ | |
libudunits2-dev \ | |
libproj-dev \ | |
libgdal-dev \ | |
libgeos-dev | |
- name: Install Pandoc | |
if: ${{ ! github.event.inputs.ghpages }} | |
uses: r-lib/actions/setup-pandoc@v2 | |
with: | |
pandoc-version: '2.17.1.1' | |
- uses: r-lib/actions/setup-renv@v2 | |
- name: Cache bookdown results | |
uses: actions/cache@v1 | |
with: | |
path: _bookdown_files | |
key: bookdown-${{ hashFiles('**/*Rmd') }} | |
restore-keys: bookdown- | |
- name: Install cmdstan | |
run: | | |
cmdstanr::check_cmdstan_toolchain(fix = TRUE) | |
cmdstanr::install_cmdstan(cores = 2) | |
shell: Rscript {0} | |
- name: Build site | |
run: Rscript -e 'bookdown::render_book("index.Rmd", quiet = TRUE)' | |
- name: Deploy 🚀 | |
# only deploy when push to main | |
if: github.event_name != 'pull_request' | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
# The branch the action should deploy to. | |
branch: gh-pages | |
# The folder the action should deploy. Adapt if you changed in Quarto config | |
folder: _book |