7
7
# Or when triggered manually
8
8
workflow_dispatch : {}
9
9
10
- name : Build WASM R package, Repo, and pkgdown website to deploy onto GH Pages
10
+ name : R WASM & { pkgdown} deploy
11
11
12
12
jobs :
13
13
rwasmbuild :
@@ -22,12 +22,15 @@ jobs:
22
22
steps :
23
23
- name : Checkout repository
24
24
uses : actions/checkout@v4
25
-
25
+
26
+ # Build the local R package and structure the CRAN repository
26
27
- name : Build WASM R packages
27
28
uses : r-wasm/actions/build-rwasm@v1
28
29
with :
29
30
packages : " ."
30
31
repo-path : " _site"
32
+
33
+ # Upload the CRAN repository for use in the next step
31
34
- name : Upload build artifact
32
35
uses : actions/upload-artifact@v3
33
36
with :
36
39
_site
37
40
38
41
pkgdown :
39
- needs : rwasmbuild
40
42
runs-on : ubuntu-latest
43
+ # Add a dependency on the prior job completing
44
+ needs : rwasmbuild
45
+ # Required for the gh-pages deployment action
41
46
environment :
42
47
name : github-pages
43
48
# Only restrict concurrency for non-PR jobs
52
57
pages : write
53
58
id-token : write
54
59
steps :
60
+ # Usual steps for generating a pkgdown website
55
61
- uses : actions/checkout@v3
56
62
57
63
- uses : r-lib/actions/setup-pandoc@v2
@@ -64,19 +70,29 @@ jobs:
64
70
with :
65
71
extra-packages : any::pkgdown, local::.
66
72
needs : website
67
-
73
+ # Change the build directory from `docs` to `_site`
74
+ # For parity with where the R WASM package repository is setup
68
75
- name : Build site
69
76
run : pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE, dest_dir = "_site")
70
77
shell : Rscript {0}
78
+
79
+ # New material ---
71
80
81
+ # Download the built R WASM CRAN repository from the prior step.
82
+ # Extract it into the `_site` directory
72
83
- name : Download build artifact
73
84
uses : actions/download-artifact@v3
74
85
with :
75
86
name : rwasmrepo
76
87
path : _site
77
-
88
+
89
+ # Upload a tar file that will work with GitHub Pages
78
90
- name : Upload Pages artifact
79
91
uses : actions/upload-pages-artifact@v2
92
+
93
+ # Use an Action deploy to push the artifact onto GitHub Pages
94
+ # This requires the `Action` tab being structured to allow for deployment
95
+ # instead of using `docs/` or the `gh-pages` branch of the repository
80
96
- name : Deploy to GitHub Pages
81
97
id : deployment
82
98
uses : actions/deploy-pages@v2
0 commit comments