Render README #142
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
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- master | |
paths: | |
- README.Rmd | |
- .github/workflows/readme.yml | |
schedule: | |
- cron: '0 12 * * *' | |
name: Render README | |
jobs: | |
render: | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
name: Render README | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Prepare repository | |
run: git checkout "${GITHUB_REF:11}" | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
- name: Render README | |
run: Rscript -e 'rmarkdown::render("README.Rmd", output_format = "github_document", params = list(AIRTABLE_API_KEY = ${{ secrets.AIRTABLE_API_KEY }}))' | |
env: # Set the secrets as an input | |
AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }} | |
AIRTABLE_ID: ${{ secrets.AIRTABLE_ID }} | |
- name: Commit results | |
run: | | |
git commit README.md -m 'Re-build README.Rmd' || echo "No changes to commit" | |
git push https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git HEAD:${{ github.ref }} || echo "No changes to commit" |