This repository has been archived by the owner on Jan 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (42 loc) · 1.6 KB
/
main.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
on:
push:
branches: master
schedule:
- cron: '30 12 * * 1'
name: render
jobs:
render:
runs-on: macOS-latest
if: "github.event_name == 'schedule' || contains(github.event.head_commit.message, '[docs]')"
steps:
- uses: actions/checkout@v2
- name: Prepare repository
run: git checkout "${GITHUB_REF:11}"
- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-pandoc@v1
- name: Install dependencies
run: |
install.packages("remotes")
remotes::install_deps(dependencies = TRUE)
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}
- name: Cache R packages
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: macOS-r-4.0-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: macOS-r-4.0-1-
- name: Install cchecks
run: |
install.packages("remotes")
remotes::install_github("ropenscilabs/cchecks", upgrade = "never")
shell: Rscript {0}
- name: Render Rmd
run: Rscript -e 'source("make.R")'
env: # Set the secret as an input
CCHECKS_EMAIL: ${{ secrets.CCHECKS_EMAIL }}
CCHECKS_TOKEN: ${{ secrets.CCHECKS_TOKEN }}
- name: Commit results
run: |
git commit * -m 'Re-build docs' || 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"