Staging #45
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
# # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | |
# # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | |
--- | |
name: Deploy Toolkit | |
on: | |
push: | |
branches: [main, master] | |
pull_request: | |
branches: [main, master] | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
deploy_toolkit: | |
runs-on: ubuntu-latest | |
# Only restrict concurrency for non-PR jobs | |
concurrency: | |
group: deploy-staging-${{ github.event_name != 'pull_request' || github.run_id }} | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
permissions: | |
contents: write | |
pages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up R and Pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
with: | |
pandoc-version: 'latest' | |
- name: Set up R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- name: Install system dependencies | |
run: | | |
sudo apt-get install -y libudunits2-dev libgdal-dev | |
sudo apt-get install libmagick++-dev | |
- name: Install R packages | |
run: | | |
R -e 'install.packages(c("bookdown", "rmarkdown", "plotly", "shiny", "tidycensus", "tidyverse", "viridis", "ggmap", "ggplot2", "maps", "dplyr", "knitr", "latticeExtra", "pals", "classInt", "sf", "udunits2", "tmap", "lubridate", "gifski", "magick", "cowplot"))' | |
R -e 'if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager"); BiocManager::install("Biobase")' | |
- name: Build site for staging branch | |
run: R -e 'bookdown::render_book(".", "bookdown::gitbook")' | |
- name: Debug Repository State | |
run: | | |
git status | |
ls -la | |
- name: Deploy to GitHub pages 🚀 | |
if: github.event_name != 'pull_request' | |
uses: JamesIves/[email protected] | |
with: | |
clean: false | |
branch: gh-pages | |
folder: ./docs |