render-EpiNow2 #4
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/master/examples | |
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | |
on: | |
push: | |
paths: | |
- 'vignettes/EpiNow2.Rmd.orig' | |
branches: [main] | |
schedule: | |
- cron: '0 0 1 * *' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref }} | |
cancel-in-progress: true | |
name: render-EpiNow2 | |
jobs: | |
EpiNow2: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: local::. | |
- name: Render vignette | |
run: | | |
setwd("vignettes") | |
knitr::knit( | |
"EpiNow2.Rmd.orig", | |
"EpiNow2.Rmd" | |
) | |
shell: Rscript {0} | |
- name: Upload vignette as an artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: vignettes | |
path: vignettes | |
- name: Create Pull Request | |
if: github.ref == 'refs/heads/main' | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
commit-message: "Automatic Vignette update" | |
title: "Update EpiNow2 vignette" | |
body: "This is an automated pull request to update the EpiNow2 vignette." | |
branch: "update-EpiNow2-${{ github.run_number }}" | |
labels: "documentation" | |
add-paths: | | |
vignettes | |
token: ${{ secrets.GITHUB_TOKEN }} |