-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (34 loc) · 1.38 KB
/
render-rmarkdown.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
on:
schedule:
- cron: '00 10,22 * * *'
push:
branches: main
name: Min Workflow for Automated Data
jobs:
render:
name: Min Workflow for Automated Data
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-pandoc@v1
- name: Query dependencies
run: Rscript -e 'install.packages("remotes");saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2);writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")'
- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
- name: Install dependencies
run: Rscript -e 'remotes::install_deps()'
- name: Render R Markdown
run: Rscript -e 'rmarkdown::render(input = "index.Rmd", output_dir="docs")'
- name: Commit results
run: |
git add -A
git commit -m 'New Data Detected - data updated!' || echo "No changes to commit"
git push origin || echo "No changes to commit"