-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 1.57 KB
/
Copy pathpkgdown.yaml
File metadata and controls
57 lines (48 loc) · 1.57 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
# Build and deploy pkgdown site to GitHub Pages
on:
push:
branches: [main, dev]
pull_request:
branches: [main]
workflow_dispatch:
name: pkgdown
jobs:
pkgdown:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- 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
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE)
shell: Rscript {0}
- name: Remove dev-only pages
run: |
rm -f docs/AGENTS.html docs/AGENTS.md docs/AGENTS.new.html docs/AGENTS.new.md
- name: Clean search index
run: |
import json, sys
with open("docs/search.json", encoding="utf-8") as f:
data = json.load(f)
before = len(data)
data = [e for e in data if "AGENTS" not in e.get("path","")]
with open("docs/search.json", "w", encoding="utf-8") as f:
json.dump(data, f, ensure_ascii=False)
print(f"Search entries: {before} -> {len(data)}")
shell: python
- name: Deploy to GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs