-
Notifications
You must be signed in to change notification settings - Fork 6
49 lines (42 loc) · 1.48 KB
/
render.yml
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
38
39
40
41
42
43
44
45
46
47
48
49
on:
push:
paths:
- '**.Rmd'
- '.github/workflows/*'
workflow_dispatch:
schedule:
# daily in the morning for America/New_York (hours in UTC)
- cron: '0 12 * * *'
repository_dispatch:
# for use with peter-evans/repository_dispatch@v1
types: ['status-update']
name: Render Status
jobs:
render:
name: Render Status
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2 # This is important to set for `git diff-tree` to work below
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r-dependencies@v2
- name: Render Status Page
run: Rscript .github/render.R
- name: Config git
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
- name: Commit status update
if: github.event_name != 'repository_dispatch'
run: |
git commit --all -m "[status] $(date +'%F %T %Z')" || echo "No changes to commit"
git push origin || echo "No changes to commit"
- name: Commit dispatched status update
if: github.event_name == 'repository_dispatch'
run: |
git commit --all -m "[status] ${{ github.event.client_payload.repo }}$(date +'%F %T %Z')" || echo "No changes to commit"
git push origin || echo "No changes to commit"