Skip to content

Python development environment #241

Python development environment

Python development environment #241

on:
push:
branches:
- master
name: renderbook
jobs:
bookdown:
name: Render-Book
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-pandoc@v1
- name: Install sf
run: Rscript -e 'install.packages("sf", type="mac.binary")'
- name: Install terra
run: Rscript -e 'install.packages("terra", type="mac.binary")'
- name: Install tidyverse
run: Rscript -e 'install.packages(c("broom","tidyverse","janitor"))'
- name: Install readxl
run: Rscript -e 'install.packages("readxl")'
- name: Install spatial
run: Rscript -e 'install.packages(c("leafem", "PostcodesioR", "mapview"))'
- name: Install api
run: Rscript -e 'install.packages(c("httr","jsonlite", "httr2"))'
- name: Install rstudio
run: Rscript -e 'install.packages("rstudioapi")'
- name: Install rmarkdown
run: Rscript -e 'install.packages(c("rmarkdown","bookdown","knitr"))'
- name: Install bs4_book
run: Rscript -e 'install.packages(c("bslib","downlit"))'
- name: Render Book
run: Rscript -e 'bookdown::render_book("index.Rmd")'
- uses: actions/upload-artifact@v1
with:
name: _book
path: _book/
# Need to first create an empty gh-pages branch
# see https://pkgdown.r-lib.org/reference/deploy_site_github.html
# and also add secrets for a GH_PAT and EMAIL to the repository
# gh-action from Cecilapp/GitHub-Pages-deploy
checkout-and-deploy:
runs-on: ubuntu-latest
needs: bookdown
steps:
- name: Checkout
uses: actions/checkout@master
- name: Download artifact
uses: actions/download-artifact@v1.0.0
with:
# Artifact name
name: _book # optional
# Destination path
path: _book # optional
- name: Deploy to GitHub Pages
uses: Cecilapp/GitHub-Pages-deploy@master
with:
build_dir: _book/
email: ${{ secrets.EMAIL }}
env:
EMAIL: ${{ secrets.EMAIL }} # must be a verified email
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/settings/tokens
BUILD_DIR: _book/ # "_site/" by default