-
Notifications
You must be signed in to change notification settings - Fork 4
37 lines (34 loc) · 1.19 KB
/
readme.yml
File metadata and controls
37 lines (34 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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"