Skip to content

use inputPath instead of dataPath per latest best practices #21

use inputPath instead of dataPath per latest best practices

use inputPath instead of dataPath per latest best practices #21

on:
pull_request:
branches:
- master
- development
push:
branches:
- master
- development
paths:
- .github/workflows/render-module-rmd.yaml
- Biomass_regeneration.Rmd
- Biomass_regeneration.R
name: Render module Rmd
jobs:
render:
name: Render module Rmd
runs-on: ubuntu-20.04
env:
RSPM: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-pandoc@v1
- name: Install GDAL and other dependencies
run: |
sudo apt-get install -y \
libcurl4-openssl-dev \
libgdal-dev \
libgeos-dev \
libgit2-dev \
libglpk-dev \
libmagick++-dev \
libproj-dev \
libudunits2-dev \
libxml2-dev \
python3-gdal
- name: Install remotes, knitr, rmarkdown
run: |
install.packages("remotes")
remotes::install_cran("rmarkdown")
remotes::install_cran("knitr")
shell: Rscript {0}
- name: Install SpaDES
run: |
install.packages("SpaDES", dependencies = TRUE)
shell: Rscript {0}
- name: Install module package dependencies
run: |
pkgs <- SpaDES.core::packages(modules = "Biomass_regeneration", paths = "..")
Require::Require(pkgs[[1]])
shell: Rscript {0}
- name: Render module Rmd
run: |
rmarkdown::render("Biomass_regeneration.Rmd", encoding = "UTF-8")
shell: Rscript {0}
- name: Commit results
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
git commit Biomass_regeneration.html -m 'Re-build Biomass_regeneration.Rmd' || echo "No changes to commit"
git push https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git HEAD:${{github.ref}} || echo "No changes to commit"