7
7
# Or when triggered manually
8
8
workflow_dispatch : {}
9
9
10
- name : Build WASM R package and Repo
10
+ name : Build WASM R package, Repo, and pkgdown website to deploy onto GH Pages
11
11
12
12
jobs :
13
- deploy-cran-repo :
13
+ rwasmbuild :
14
14
# Only restrict concurrency for non-PR jobs
15
15
concurrency :
16
16
group : r-wasm-${{ github.event_name != 'pull_request' || github.run_id }}
@@ -28,11 +28,55 @@ jobs:
28
28
with :
29
29
packages : " ."
30
30
repo-path : " _site"
31
+ - name : Upload build artifact
32
+ uses : actions/upload-artifact@v3
33
+ with :
34
+ name : rwasmrepo
35
+ path : |
36
+ _site
37
+
38
+ pkgdown :
39
+ needs : rwasmbuild
40
+ runs-on : ubuntu-latest
41
+ # Only restrict concurrency for non-PR jobs
42
+ concurrency :
43
+ group : pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
44
+ env :
45
+ GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
46
+ permissions :
47
+ # To download GitHub Packages within action
48
+ repository-projects : read
49
+ # For publishing to pages environment
50
+ pages : write
51
+ id-token : write
52
+ steps :
53
+ - uses : actions/checkout@v3
31
54
32
- - name : Deploy wasm R packages to GitHub pages 🚀
33
- if : github.event_name != 'pull_request'
34
- uses : JamesIves/github-pages-deploy-action@v4.4.1
55
+ - uses : r-lib/actions/setup-pandoc@v2
56
+
57
+ - uses : r-lib/actions/setup-r@v2
58
+ with :
59
+ use-public-rspm : true
60
+
61
+ - uses : r-lib/actions/setup-r-dependencies@v2
62
+ with :
63
+ extra-packages : any::pkgdown, local::.
64
+ needs : website
65
+
66
+ - name : Build site
67
+ run : pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
68
+ shell : Rscript {0}
69
+
70
+ - name : Download build artifact
71
+ uses : actions/download-artifact@v3
35
72
with :
36
- clean : false
37
- branch : gh-pages
38
- folder : _site
73
+ name : rwasmrepo
74
+
75
+ - name : Upload Pages artifact
76
+ uses : actions/upload-pages-artifact@v2
77
+ - name : Deploy to GitHub Pages
78
+ id : deployment
79
+ uses : actions/deploy-pages@v2
80
+
81
+
82
+
0 commit comments