-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (40 loc) · 1.28 KB
/
render-vignette.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
# Candace Savonen Jan 2024
name: Render vignette with Docker image
on:
workflow_dispatch:
pull_request:
branches: [ main, staging ]
push:
branches: [ main, staging ]
paths:
- R/*
- inst/extdata/*
jobs:
render-vignette:
name: Render test
runs-on: ubuntu-latest
container:
image: cansav09/gimap
steps:
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Login as jhudsl-robot
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git config --global user.email "itcrtrainingnetwork@gmail.com"
git config --global user.name "jhudsl-robot"
- name: Run vignette
run: Rscript -e "rmarkdown::render('vignettes/getting-started.Rmd')"
# Commit the rendered bookdown files
- name: Commit rendered files
env:
GH_PAT: ${{ secrets.GH_PAT }}
run: |
git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY}
git fetch origin
git add --force docs/*
git commit -m 'Render vignette' || echo "No changes to commit"
git pull --allow-unrelated-histories --strategy-option=ours
git push -u origin main || echo "No changes to push"