Skip to content

build-deploy-rmd

build-deploy-rmd #210

on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '0 9 * * 3'
name: build-deploy-rmd
jobs:
build-deploy-rmd:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
CRAN: ${{ matrix.config.cran }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Check out repo
uses: actions/checkout@v2
with:
submodules: true
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
- name: Set up pandoc
uses: r-lib/actions/setup-pandoc@v2
## rcrossref requires an email address associated with a query
- name: Set up crossref email
run: |
echo crossref_email=\"${{ secrets.CROSSREF_EMAIL }}\" >> ~/.Renviron
- name: Install dependencies
run: |
install.packages(c('remotes', 'dplyr', 'ggplot2', 'rmarkdown',
'knitr', 'tibble', 'tidyr',
'lubridate', 'gh', 'jsonlite', 'purrr',
'DT', 'plotly', 'citecorp', 'readr',
'viridis', 'wordcloud'), Ncpu = 2L)
remotes::install_github('ropensci/rcrossref')
shell: Rscript {0}
- name: Session info
run: |
install.packages('sessioninfo', Ncpus = 2L)
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
- name: Render site
run: |
rmarkdown::render(input = "joss-submission-analytics.Rmd", clean = FALSE)
shell: Rscript {0}
- name: Prepare files to deploy
run: |
mkdir _site
cp -r joss-submission-analytics_files joss-submission-analytics.html _site/
cp -r joss_submission_analytics.rds _site/
cp -r joss_submission_citations_byjournal.tsv _site/
cp -r joss_submission_citations.tsv _site/
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: _site
- name: Upload check results
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
- name: upload artifact
uses: actions/upload-artifact@v1
with:
name: submissionanalytics
path: joss_submission_analytics.rds