77 # Or when triggered manually
88 workflow_dispatch : {}
99
10- name : Build WASM R package, Repo, and pkgdown website to deploy onto GH Pages
10+ name : R WASM & { pkgdown} deploy
1111
1212jobs :
1313 rwasmbuild :
@@ -22,12 +22,15 @@ jobs:
2222 steps :
2323 - name : Checkout repository
2424 uses : actions/checkout@v4
25-
25+
26+ # Build the local R package and structure the CRAN repository
2627 - name : Build WASM R packages
2728 uses : r-wasm/actions/build-rwasm@v1
2829 with :
2930 packages : " ."
3031 repo-path : " _site"
32+
33+ # Upload the CRAN repository for use in the next step
3134 - name : Upload build artifact
3235 uses : actions/upload-artifact@v3
3336 with :
3639 _site
3740
3841 pkgdown :
39- needs : rwasmbuild
4042 runs-on : ubuntu-latest
43+ # Add a dependency on the prior job completing
44+ needs : rwasmbuild
45+ # Required for the gh-pages deployment action
4146 environment :
4247 name : github-pages
4348 # Only restrict concurrency for non-PR jobs
5257 pages : write
5358 id-token : write
5459 steps :
60+ # Usual steps for generating a pkgdown website
5561 - uses : actions/checkout@v3
5662
5763 - uses : r-lib/actions/setup-pandoc@v2
@@ -64,19 +70,29 @@ jobs:
6470 with :
6571 extra-packages : any::pkgdown, local::.
6672 needs : website
67-
73+ # Change the build directory from `docs` to `_site`
74+ # For parity with where the R WASM package repository is setup
6875 - name : Build site
6976 run : pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE, dest_dir = "_site")
7077 shell : Rscript {0}
78+
79+ # New material ---
7180
81+ # Download the built R WASM CRAN repository from the prior step.
82+ # Extract it into the `_site` directory
7283 - name : Download build artifact
7384 uses : actions/download-artifact@v3
7485 with :
7586 name : rwasmrepo
7687 path : _site
77-
88+
89+ # Upload a tar file that will work with GitHub Pages
7890 - name : Upload Pages artifact
7991 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
8096 - name : Deploy to GitHub Pages
8197 id : deployment
8298 uses : actions/deploy-pages@v2
0 commit comments