-
Notifications
You must be signed in to change notification settings - Fork 36
65 lines (61 loc) · 2.4 KB
/
Copy pathwebsite.yaml
File metadata and controls
65 lines (61 loc) · 2.4 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Website Docs Update
# only build on new tagged versions (OR manually specified)
on:
push:
tags:
- 'v*'
workflow_dispatch:
# automatically cancel in-progress builds if another commit is pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# default to read-only permissions
# (job-level overrides add the minimal permissions needed)
permissions:
contents: read
jobs:
build-website:
name: build website docs on website_docs_update branch
runs-on: macos-latest
steps:
- name: checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false
- name: Get Latest Version Tag
id: previoustag
uses: WyriHaximus/github-action-get-previous-tag@61819f33034117e6c686e6a31dba995a85afc9de # v2.0.0
with:
prefix: 'v'
- name: Git Checkout Branch From Latest Version Tag
env:
PREVIOUS_TAG: ${{ steps.previoustag.outputs.tag }}
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git checkout -b website_docs_update "${PREVIOUS_TAG}"
- name: set up R
uses: r-lib/actions/setup-r@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590 # v2.11.4
with:
r-version: 'release'
- uses: r-lib/actions/setup-pandoc@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590 # v2.11.4
- uses: r-lib/actions/setup-tinytex@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590 # v2.11.4
- uses: r-lib/actions/setup-r-dependencies@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590 # v2.11.4
with:
packages: pkgdown
- name: Build Site
run: pkgdown::build_site()
shell: Rscript {0}
- name: Save Site Docs Articfact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: "built_website_docs_${{steps.previoustag.outputs.tag}}"
path: ${{github.workspace}}/docs/
- name: Commit website doc changes (overwrite if existing)
env:
PREVIOUS_TAG: ${{ steps.previoustag.outputs.tag }}
run: |
git add docs/\*
git commit -m "Update website documentation to ${PREVIOUS_TAG}" || echo "No changes to commit"
git push -f origin website_docs_update