-
Notifications
You must be signed in to change notification settings - Fork 37
50 lines (48 loc) · 1.69 KB
/
website.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
39
40
41
42
43
44
45
46
47
48
49
50
name: Website Docs Update
# only build on new tagged versions (OR manually specified)
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build-website:
name: build website docs on website_docs_update branch
runs-on: macos-latest
steps:
- name: checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # pull all tags and other history
- name: Get Latest Version Tag
id: previoustag
uses: WyriHaximus/[email protected]
with:
prefix: 'v'
- name: Git Checkout Branch From Latest Version Tag
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git checkout -b website_docs_update ${{steps.previoustag.outputs.tag}}
- name: set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-tinytex@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: pkgdown
- name: Build Site
run: pkgdown::build_site()
shell: Rscript {0}
- name: Save Site Docs Articfact
uses: actions/upload-artifact@v4
with:
name: "built_website_docs_${{steps.previoustag.outputs.tag}}"
path: ${{github.workspace}}/docs/
- name: Commit website doc changes (overwrite if existing)
run: |
git add docs/\*
git commit -m "Update website documentation to ${{steps.previoustag.outputs.tag}}" || echo "No changes to commit"
git push -f origin website_docs_update