-
Notifications
You must be signed in to change notification settings - Fork 49
86 lines (72 loc) · 2.36 KB
/
build.yaml
File metadata and controls
86 lines (72 loc) · 2.36 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Development build
on:
push:
branches: [main]
workflow_dispatch:
jobs:
build:
name: Dev build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
dependencies: NA
extra-packages: any::devtools
- name: Build package
run: |
make documentation
- name: Commit development build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name $GITHUB_ACTOR
git config user.email $GITHUB_ACTOR@users.noreply.github.com
git remote set-url --push origin https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git
git checkout -b build
git add --force NAMESPACE man
git commit -m 'Create a development build'
git push --force origin build
docs:
name: Publish documentation
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v6
with:
ref: build
fetch-depth: 0
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y inkscape pngcrush
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
dependencies: NA
extra-packages: any::pkgdown
- name: Build documentation
run: |
if Rscript -e 'quit(status = if (pkgdown::as_pkgdown()$development$in_dev) 0 else 1)' >/dev/null 2>&1; then
# Preserve release documentation website, if it exists.
git cherry-pick origin/site || :
fi
make site
- name: Publish documentation
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name $GITHUB_ACTOR
git config user.email $GITHUB_ACTOR@users.noreply.github.com
git remote set-url --push origin https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git
git branch -D -r origin/site || :
git checkout -b site
git add --force docs
if [ -d docs/dev ]; then
dev='dev '
else
dev=''
fi
git commit -m "Build ${dev}documentation"
git push --force origin site