-
Notifications
You must be signed in to change notification settings - Fork 28
38 lines (35 loc) · 1.23 KB
/
knit.yaml
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
on:
push:
branches:
- main
# pull_request:
# types:
# - closed
jobs:
if_merged:
if: github.event.pull_request.merged == true
runs-on: macOS-latest
steps:
- run: |
echo The PR was merged
- name: Install R dependencies
run: |
install.packages(c("jsonlite", "jsonvalidate", "rmarkdown", "reticulate", "here"),
repos = "https://cloud.r-project.org/")
shell: Rscript {0}
- name: Install Python dependencies
uses: py-actions/py-dependency-install@v4
- name: Render readme files
#if: github.event_name == 'push'
run: rmarkdown::render("README.Rmd", output_format = "github_document")
shell: Rscript {0}
- name: Commit data
#if: github.event_name == 'push'
env:
GITHUB_PAT: ${{ secrets.SECRET_WRITE }}
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git commit blogs/ -m 'Commit cleaned jsons' || echo "No changes to commit"
git commit README.md -m 'Re-knit readme files' || echo "No changes to commit"
git push origin || echo "Nothing to push"