3
3
on :
4
4
push :
5
5
branches : [main, master]
6
- pull_request :
7
- branches : [main, master]
8
6
release :
9
7
types : [published]
10
8
workflow_dispatch :
@@ -13,22 +11,16 @@ name: pkgdown
13
11
14
12
jobs :
15
13
pkgdown :
16
- if : github.event_name == 'push' || github.event.pull_request.head.repo.fork == false
17
14
runs-on : ubuntu-latest
18
15
# Only restrict concurrency for non-PR jobs
19
16
concurrency :
20
17
group : pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
21
18
env :
22
19
GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
23
- NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
24
- NETLIFY_SITE_ID : ${{ secrets.NETLIFY_SITE_ID }}
25
- isPush : ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
26
20
permissions :
27
21
contents : write
28
22
steps :
29
- - uses : actions/checkout@v3
30
-
31
- - uses : r-lib/actions/setup-tinytex@v2
23
+ - uses : actions/checkout@v4
32
24
33
25
- uses : r-lib/actions/setup-pandoc@v2
34
26
@@ -41,40 +33,14 @@ jobs:
41
33
extra-packages : any::pkgdown, local::.
42
34
needs : website
43
35
44
- - name : Install package
45
- run : R CMD INSTALL .
46
-
47
- - name : Build and deploy pkgdown site
48
- if : contains(env.isPush, 'true')
49
- run : |
50
- git config --local user.name "$GITHUB_ACTOR"
51
- git config --local user.email "[email protected] "
52
- Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
53
-
54
- - name : Create website
55
- if : contains(env.isPush, 'false')
56
- run : |
57
- pkgdown::build_site()
36
+ - name : Build site
37
+ run : pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
58
38
shell : Rscript {0}
59
39
60
- - name : Create index file
61
- if : contains(env.isPush, 'false')
62
- run : |
63
- echo '<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0;URL=/dev/index.html" /> <script language="javascript"> window.location.replace('/dev/index.html')</script></head></html>' > ./docs/index.html
64
-
65
- - name : Deploy to Netlify
66
- if : contains(env.isPush, 'false')
67
- id : netlify-deploy
68
-
40
+ - name : Deploy to GitHub pages 🚀
41
+ if : github.event_name != 'pull_request'
42
+
69
43
with :
70
- publish-dir : ' ./docs'
71
- production-branch : master
72
- github-token : ${{ secrets.GITHUB_TOKEN }}
73
- deploy-message :
74
- ' Deploy from GHA: ${{ github.event.pull_request.title || github.event.head_commit.message }} (${{ github.sha }})'
75
- # these all default to 'true'
76
- enable-pull-request-comment : false
77
- enable-commit-comment : false
78
- # enable-commit-status: true
79
- # overwrites-pull-request-comment: true
80
- timeout-minutes : 1
44
+ clean : false
45
+ branch : gh-pages
46
+ folder : docs
0 commit comments