Merge pull request #264 from DrEspresso/master #55
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
name: render readme and pkgdown | |
# Controls when the action will run | |
on: | |
push: | |
branches: master | |
jobs: | |
render: | |
# The type of runner that the job will run on | |
runs-on: macOS-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@master | |
- uses: r-lib/actions/setup-r@v2 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: Install XQuartz on macOS | |
if: runner.os == 'macOS' | |
run: brew install --cask xquartz | |
- name: Install harfbuzz on macOS | |
if: runner.os == 'macOS' | |
run: brew install harfbuzz | |
- name: Install fribidi on macOS | |
if: runner.os == 'macOS' | |
run: brew install fribidi | |
- name: Query dependencies | |
run: | | |
install.packages(c('remotes', 'devtools')) | |
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) | |
shell: Rscript {0} | |
#- name: Cache R packages | |
# uses: actions/cache@v1 | |
# with: | |
# path: ${{ env.R_LIBS_USER }} | |
# key: macOS-r-4.0-1-${{ hashFiles('.github/depends.Rds') }} | |
# restore-keys: macOS-r-4.0-1- | |
- name: Install dependencies, create helpfiles | |
run: | | |
remotes::install_deps(dependencies = TRUE) | |
devtools::document() | |
shell: Rscript {0} | |
- name: commit newly made helpfiles | |
run: | | |
git add man/* || echo "No changes to commit" | |
git commit -m "Re-build docs" || echo "No changes to commit" | |
git push origin master || echo "No changes to commit" | |
- name: Install package | |
run: R CMD INSTALL . | |
# install packages needed | |
- name: install required packages | |
run: Rscript -e 'install.packages(c("rmarkdown", "knitr", "badger", "pkgdown"))' | |
# Render READEME.md using rmarkdown | |
- name: render README | |
run: Rscript -e 'rmarkdown::render("README.Rmd", output_format = "md_document")' | |
- name: commit rendered README | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Render action" | |
git add README.md | |
git commit -m "Re-build README.md" || echo "No changes to commit" | |
git push origin master || echo "No changes to commit" | |
- name: Deploy package | |
run: pkgdown::deploy_to_branch(new_process = FALSE) | |
shell: Rscript {0} |