1
- # Workflow derived from https://github.com/r-lib/actions/tree/master /examples
1
+ # Workflow derived from https://github.com/r-lib/actions/tree/v2 /examples
2
2
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3
3
on :
4
4
push :
5
5
branches : [main, master]
6
+ pull_request :
7
+ branches : [main, master]
6
8
release :
7
9
types : [published]
8
10
workflow_dispatch :
9
11
10
12
name : pkgdown
11
13
14
+ permissions : read-all
15
+
12
16
jobs :
13
17
pkgdown :
14
18
runs-on : ubuntu-latest
19
+ # Only restrict concurrency for non-PR jobs
20
+ concurrency :
21
+ group : pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
15
22
env :
16
23
GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
24
+ permissions :
25
+ contents : write
17
26
steps :
18
- - uses : actions/checkout@v2
27
+ - uses : actions/checkout@v4
19
28
20
- - uses : r-lib/actions/setup-pandoc@v1
29
+ - uses : r-lib/actions/setup-pandoc@v2
21
30
22
- - uses : r-lib/actions/setup-r@v1
31
+ - uses : r-lib/actions/setup-r@v2
23
32
with :
24
33
use-public-rspm : true
25
34
26
- - uses : r-lib/actions/setup-r-dependencies@v1
35
+ - uses : r-lib/actions/setup-r-dependencies@v2
27
36
with :
28
- extra-packages : pkgdown
37
+ extra-packages : any:: pkgdown, local::.
29
38
needs : website
30
39
31
- - name : Deploy package
32
- run : |
33
- git config --local user.name "$GITHUB_ACTOR"
34
- git config --local user.email "[email protected] "
35
- Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
40
+ - name : Build site
41
+ run : pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
42
+ shell : Rscript {0}
43
+
44
+ - name : Deploy to GitHub pages 🚀
45
+ if : github.event_name != 'pull_request'
46
+
47
+ with :
48
+ clean : false
49
+ branch : gh-pages
50
+ folder : docs
0 commit comments