Skip to content

Commit fa5a141

Browse files
committed
Add GitHub Actions workflow for pkgdown
1 parent bdda172 commit fa5a141

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/pkgdown.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build and Deploy pkgdown Site
2+
3+
on:
4+
push:
5+
branches:
6+
- main # Trigger the workflow on pushes to the main branch
7+
8+
jobs:
9+
build-deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
# Checkout the repository
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
17+
# Set up R
18+
- name: Set up R
19+
uses: r-lib/actions/setup-r@v2
20+
with:
21+
r-version: '4.3' # Adjust to your R version
22+
23+
# Install dependencies
24+
- name: Install dependencies
25+
run: |
26+
install.packages('remotes')
27+
remotes::install_deps(dependencies = TRUE)
28+
29+
# Build the pkgdown site
30+
- name: Build pkgdown site
31+
run: |
32+
install.packages('pkgdown')
33+
pkgdown::build_site()
34+
35+
# Deploy to gh-pages branch
36+
- name: Deploy to GitHub Pages
37+
uses: peaceiris/actions-gh-pages@v3
38+
with:
39+
github_token: ${{ secrets.GITHUB_TOKEN }}
40+
publish_dir: ./docs
41+
publish_branch: gh-pages

0 commit comments

Comments
 (0)