Skip to content

Commit b8b9813

Browse files
committed
Improve clarity of steps taken
1 parent 2bb6d70 commit b8b9813

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

.github/workflows/deploy-cran-repo.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
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

1212
jobs:
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:
@@ -36,8 +39,10 @@ jobs:
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
@@ -52,6 +57,7 @@ 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

Comments
 (0)