-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (87 loc) · 3.33 KB
/
Copy pathpkgdown.yaml
File metadata and controls
97 lines (87 loc) · 3.33 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Builds the ecosystem documentation site and deploys it to gh-pages:
#
# / the monorepo landing page (rendered from README.md)
# /Rfmalloc/ \
# /Rgguf/ | one pkgdown site per package
# /Rggml/ |
# /Rllm/ /
#
# Siblings are installed from THIS checkout with plain R CMD INSTALL (never
# pak's solver, which would resolve the DESCRIPTIONs' Remotes refs against
# GitHub main) so the docs describe the code in the commit being built.
on:
push:
branches: [main, master]
pull_request:
release:
types: [published]
workflow_dispatch:
name: pkgdown.yaml
permissions: read-all
jobs:
pkgdown:
runs-on: ubuntu-latest
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- name: Install CRAN tooling
run: |
install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))
pak::pkg_install(c("any::pkgdown", "any::litedown", "any::tinytest",
"any::bench", "any::lobstr", "any::knitr",
"any::rmarkdown"),
ask = FALSE)
shell: Rscript {0}
- name: Install the stack in dependency order (pkgdown needs them loadable)
run: |
for p in Rfmalloc Rggml Rgguf Rllm; do
echo "==== R CMD INSTALL packages/$p ===="
R CMD INSTALL "packages/$p" || exit 1
done
shell: bash
- name: Build one pkgdown site per package into _site/<pkg>
run: |
for (p in c("Rfmalloc", "Rggml", "Rgguf", "Rllm")) {
# must be absolute: pkgdown resolves a relative destination against
# the package directory, and normalizePath() cannot expand a path
# that does not exist yet.
dest <- file.path(getwd(), "_site", p)
message("==== pkgdown: ", p, " -> ", dest, " ====")
pkgdown::build_site(
pkg = file.path("packages", p),
new_process = FALSE, install = FALSE, preview = FALSE,
override = list(destination = dest)
)
}
shell: Rscript {0}
- name: Landing page from the monorepo README
run: |
dir.create("_site", recursive = TRUE, showWarnings = FALSE)
file.create("_site/.nojekyll")
options(litedown.html.template = TRUE)
litedown::mark(
"README.md",
output = "_site/index.html",
meta = list(
lang = "en",
plain_title = "Rfmalloc: out-of-core arrays for R"
)
)
print(list.files("_site", all.files = TRUE))
shell: Rscript {0}
- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
with:
clean: true # the site is fully regenerated; drop the old single-package layout
branch: gh-pages
folder: _site