fix: change env assignment #8
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
# based onhttps://github.com/horosin/pages-deploy | |
# and https://lucacozzuto.medium.com/automatic-reports-with-bookdown-and-github-actions-3c19498394aa | |
# and https://stackoverflow.com/questions/76723921/install-a-github-r-package-for-a-github-action | |
# and https://stackoverflow.com/questions/76907259/installing-package-dependencies-only-from-binary-not-source-using-remotesins | |
name: github pages | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
bookdown: | |
name: Render-Book | |
runs-on: ubuntu-20.04 | |
defaults: | |
run: | |
working-directory: ./edit_docs | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 'release' | |
rtools-version: '42' | |
use-public-rspm: true | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: Set env_config | |
run: echo "CONFIG_FILE=$'config.yml'" >> $CONFIG_FILE | |
- name: Set env_production | |
run: echo "R_ENVIRONMENT=$github" >> $R_ENVIRONMENT | |
- name: Install TinyTeX | |
uses: r-lib/actions/setup-tinytex@v2 | |
env: | |
TINYTEX_INSTALLER: TinyTeX | |
- name: Install packages | |
run: Rscript -e 'install.packages(c("rmarkdown", "bookdown", "config", "remotes", "webshot", "readr", "dplyr", "DT", "plotly", "knitr", "knitrdrawio", "config", "ggplot2", "snakecase", "readxl", "shinyLP"))' | |
- name: Install knitrdrawio | |
run: Rscript -e 'remotes::install_url("https://github.com/rchaput/knitrdrawio/archive/refs/tags/v0.2.2.tar.gz")' | |
- name: Install phantomjs | |
run: Rscript -e 'webshot::install_phantomjs()' | |
- name: Render Book | |
run: Rscript -e 'bookdown::render_book("index.Rmd", "all")' | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: _book | |
path: _book/ | |
checkout-and-deploy: | |
runs-on: ubuntu-20.04 | |
needs: bookdown | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
# Artifact name | |
name: _book # optional | |
# Destination path | |
path: _book # optional | |
- name: Deploy to GitHub Pages | |
uses: Cecilapp/GitHub-Pages-deploy@v3 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
build_dir: _book | |
branch: gh-pages |