-
Notifications
You must be signed in to change notification settings - Fork 5
66 lines (64 loc) · 2.11 KB
/
update-dev-website.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Update dev website
on:
push:
branches:
- develop
# The action needs permissions to update the branch
permissions:
contents: write
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
PKGDOWN_MODE: devel
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- name: Setup Pandoc for word conversion
uses: r-lib/actions/setup-pandoc@v2
- name: Install ospsuite ecosystem and cran packages
run: |
Rscript .github/workflows/install_dependencies.R
Rscript .github/workflows/pkgdown_setup.R
# install=TRUE is necessary to install the package prior building the vignettes
# devel=TRUE is used for convenience in case the action fails and we need to troubleshoot
- name: Build dev site
run: |
options(yaml.eval.expr=TRUE)
pkgdown::build_site(devel=TRUE, install=TRUE)
shell: Rscript {0}
# The project is then uploaded as an artifact named 'docs'.
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: docs
path: docs
deploy:
concurrency: ci-${{ github.ref }}
# The second job must depend on the first one to complete before running and uses ubuntu-latest instead of windows.
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# The built project is downloaded into the 'docs' folder.
- name: Download Artifacts
uses: actions/download-artifact@v1
with:
name: docs
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
# The deployment folder should match the name of the artifact.
# Clean is false to prevent removing release site
# only target folder of repo from gh-pages branch is updated
with:
folder: docs
clean: false
branch: gh-pages
target-folder: docs
token: ${{ secrets.GITHUB_TOKEN }}