-
Notifications
You must be signed in to change notification settings - Fork 4
70 lines (62 loc) · 1.94 KB
/
pkgdown.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Workflow derived from https://github.com/r-wasm/actions/tree/v1/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, pkg]
pull_request:
release:
types: [published]
workflow_dispatch:
name: R Wasm & pkgdown deploy
jobs:
build-site:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Usual steps for generating a pkgdown website
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website
# Change the build directory to `_site`
- name: Build site
shell: Rscript {0}
run: |
pkgdown::build_site_github_pages(
new_process = FALSE,
install = FALSE,
dest_dir = "_site"
)
# Build the local R package and structure the CRAN repository
- name: Build Wasm R packages
uses: r-wasm/actions/build-rwasm@v1
with:
packages: "."
repo-path: "_site"
# Upload an artifact that will work with GitHub Pages
- name: Upload Pages artifact
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v3
with:
path: "_site"
deploy:
if: github.event_name != 'pull_request'
needs: [build-site]
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4