Skip to content

Commit 9794d2f

Browse files
committed
Explore job sharing between locations
1 parent 205ea5b commit 9794d2f

File tree

1 file changed

+52
-8
lines changed

1 file changed

+52
-8
lines changed

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

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ on:
77
# Or when triggered manually
88
workflow_dispatch: {}
99

10-
name: Build WASM R package and Repo
10+
name: Build WASM R package, Repo, and pkgdown website to deploy onto GH Pages
1111

1212
jobs:
13-
deploy-cran-repo:
13+
rwasmbuild:
1414
# Only restrict concurrency for non-PR jobs
1515
concurrency:
1616
group: r-wasm-${{ github.event_name != 'pull_request' || github.run_id }}
@@ -28,11 +28,55 @@ jobs:
2828
with:
2929
packages: "."
3030
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
3154

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
3572
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

Comments
 (0)