Skip to content

Commit a65c629

Browse files
ci: Migrate pkgdown site deployment to GitHub Pages workflow
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
1 parent 4e67250 commit a65c629

File tree

3 files changed

+47
-9
lines changed

3 files changed

+47
-9
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
^data-raw$
55
^dev$
66
^\.github$
7+
^_pkgdown\.yml$
8+
^docs/

.github/workflows/pkgdown.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
on:
22
push:
3-
branches:
4-
- main
5-
- master
3+
branches: [main]
64
workflow_dispatch:
75

86
name: pkgdown
97

108
jobs:
119
pkgdown:
1210
runs-on: ubuntu-latest
13-
env:
14-
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1511
permissions:
16-
contents: write
12+
contents: read
13+
pages: write
14+
id-token: write
15+
1716
steps:
18-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1918

2019
- uses: r-lib/actions/setup-r@v2
2120
with:
@@ -26,6 +25,23 @@ jobs:
2625
extra-packages: any::pkgdown, local::.
2726
needs: pkgdown
2827

29-
- name: Build and deploy site
30-
run: pkgdown::build_site_github_pages()
28+
- name: Build site
29+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
3130
shell: Rscript {0}
31+
32+
- name: Upload artifact
33+
uses: actions/upload-pages-artifact@v3
34+
with:
35+
path: ./docs
36+
37+
deploy:
38+
needs: pkgdown
39+
runs-on: ubuntu-latest
40+
environment:
41+
name: github-pages
42+
url: ${{ steps.deployment.outputs.page_url }}
43+
44+
steps:
45+
- name: Deploy to GitHub Pages
46+
id: deployment
47+
uses: actions/deploy-pages@v4

_pkgdown.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,23 @@ reference:
2020
- set_hyperparameters
2121
- set_smc_options
2222
- precompute_topological_sorts
23+
url: https://oystein-sorensen.github.io/BayesMallowsSMC2
24+
template:
25+
bootstrap: 5
26+
bootswatch: cosmo
27+
28+
home:
29+
sidebar:
30+
structure: [links, license, community, citation, authors, dev]
31+
32+
navbar:
33+
structure:
34+
left: [reference, news]
35+
right: [github]
36+
components:
37+
reference:
38+
text: Reference
39+
href: reference/index.html
40+
news:
41+
text: Changelog
42+
href: news/index.html

0 commit comments

Comments
 (0)