Skip to content

Commit

Permalink
Use render-readme.yaml from epinowcast (#60)
Browse files Browse the repository at this point in the history
Former-commit-id: d55045cdab4efb2a1a4fddcebfae7d8b841b165e [formerly f074e37f558f78e8d30e129aca4365fedbaff5b6]
Former-commit-id: 04f52ca0202ce04f841003947f936ed4f12636eb
  • Loading branch information
athowes authored May 28, 2024
1 parent a4413cb commit 32bb522
Showing 1 changed file with 28 additions and 10 deletions.
38 changes: 28 additions & 10 deletions .github/workflows/render-readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ concurrency:
on:
workflow_dispatch:
push:
paths:
- 'README.Rmd'
branches:
- main

jobs:
render-readme:
Expand All @@ -28,17 +28,35 @@ jobs:
- name: Install dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rmarkdown, local::.
extra-packages: any::rmarkdown, local::., any::allcontributors

- name: Update contributors
if: github.ref == 'refs/heads/main'
run: allcontributors::add_contributors(format = "text")
shell: Rscript {0}

- name: Compile the readme
run: |
rmarkdown::render("README.Rmd")
shell: Rscript {0}

- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add README.md man/figures/
git diff-index --quiet HEAD || git commit -m "Automatic readme update [ci skip]"
git push origin || echo "No changes to push"
- name: Upload README.md as an artifact
uses: actions/upload-artifact@v4
with:
name: readme
path: README.md

- name: Create Pull Request
if: github.ref == 'refs/heads/main'
uses: peter-evans/create-pull-request@v6
with:
commit-message: "Automatic README update"
title: "Update README"
body: "This is an automated pull request to update the README."
branch: "update-readme-${{ github.run_number }}"
labels: "documentation"
reviewers: seabbs
add-paths: |
README.Rmd
README.md
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 32bb522

Please sign in to comment.