Skip to content

Commit c1edd42

Browse files
committed
Added vignette on GHA
1 parent 73bb6ae commit c1edd42

2 files changed

Lines changed: 80 additions & 7 deletions

File tree

DESCRIPTION

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ Version: 2.0.1.9000
44
Authors@R:
55
person("Visruth", "Srimath Kandali", , "public@visruth.com", role = c("aut", "cre"))
66
Description: This package is a template package, built off of the Stan
7-
Quarto styling. Exclusively for use styling `pkgdown` websites in
8-
the Stan ecosystem.
7+
Quarto styling. Exclusively for use styling `pkgdown` websites in the
8+
Stan ecosystem.
99
License: BSD_3_clause + file LICENSE
10-
URL: https://mc-stan.org/pkgdown-config, https://mc-stan.org/pkgdown-config
11-
Encoding: UTF-8
12-
Roxygen: list(markdown = TRUE)
13-
RoxygenNote: 7.3.3
10+
URL: https://mc-stan.org/pkgdown-config,
11+
https://mc-stan.org/pkgdown-config
1412
Suggests:
1513
knitr,
1614
quarto
17-
VignetteBuilder: quarto
15+
VignetteBuilder:
16+
quarto
17+
Encoding: UTF-8
18+
Roxygen: list(markdown = TRUE)
19+
RoxygenNote: 7.3.3

vignettes/GitHub Action.qmd

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: "GitHub Action"
3+
vignette: >
4+
%\VignetteIndexEntry{Quirks}
5+
%\VignetteEngine{quarto::html}
6+
%\VignetteEncoding{UTF-8}
7+
knitr:
8+
opts_chunk:
9+
collapse: true
10+
comment: '#>'
11+
---
12+
13+
Here is a GitHub Action which can be used with the theme to automatically build the site.
14+
15+
```yaml
16+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
17+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
18+
on:
19+
# build dev site on merged pushes
20+
push:
21+
branches: [main, master]
22+
# build full site on releases
23+
release:
24+
types: [published]
25+
workflow_dispatch:
26+
27+
name: pkgdown.yaml
28+
29+
concurrency:
30+
group: pages
31+
cancel-in-progress: true
32+
33+
jobs:
34+
pkgdown:
35+
runs-on: ubuntu-latest
36+
env:
37+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
38+
permissions:
39+
contents: write
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- uses: r-lib/actions/setup-pandoc@v2
44+
45+
- uses: r-lib/actions/setup-r@v2
46+
with:
47+
use-public-rspm: true
48+
49+
- uses: r-lib/actions/setup-r-dependencies@v2
50+
with:
51+
extra-packages: any::pkgdown, local::., any::withr, stan-dev/pkgdown-config
52+
53+
- name: Build site
54+
run: |
55+
withr::with_envvar(
56+
c("NOT_CRAN" = "true"), # this should already be set by setup-r@v2? keeping because vignettes don't build otherwise
57+
pkgdown::build_site_github_pages(
58+
lazy = FALSE, # change to TRUE if runner times out.
59+
run_dont_run = TRUE,
60+
new_process = TRUE
61+
)
62+
)
63+
shell: Rscript {0}
64+
65+
- name: Deploy to GitHub pages 🚀
66+
uses: JamesIves/github-pages-deploy-action@v4.5.0
67+
with:
68+
clean: false
69+
branch: gh-pages
70+
folder: docs
71+
```

0 commit comments

Comments
 (0)