Skip to content

Commit 042055d

Browse files
Broccolitoclaude
andcommitted
Add GitHub Actions workflow to auto-deploy pkgdown docs
On every push to main, builds the pkgdown site and pushes the output to BaranziniLab/baranzinilab.github.io under tkoi/. Uses PAGES_PAT secret for cross-repo write access. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9fe342e commit 042055d

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build and Deploy pkgdown
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout tkoi
14+
uses: actions/checkout@v4
15+
16+
- name: Set up R
17+
uses: r-lib/actions/setup-r@v2
18+
with:
19+
use-public-rspm: true
20+
21+
- name: Install pandoc
22+
uses: r-lib/actions/setup-pandoc@v2
23+
24+
- name: Install system dependencies
25+
run: sudo apt-get install -y libsodium-dev libcurl4-openssl-dev libssl-dev libxml2-dev
26+
27+
- name: Install R dependencies
28+
uses: r-lib/actions/setup-r-dependencies@v2
29+
with:
30+
extra-packages: |
31+
pkgdown
32+
any::devtools
33+
34+
- name: Build pkgdown site
35+
run: Rscript -e "pkgdown::build_site()"
36+
37+
- name: Deploy to baranzinilab.github.io
38+
run: |
39+
git config --global user.name "github-actions[bot]"
40+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
41+
git clone https://x-access-token:${{ secrets.PAGES_PAT }}@github.com/BaranziniLab/baranzinilab.github.io.git pages_repo
42+
rm -rf pages_repo/tkoi
43+
cp -r docs pages_repo/tkoi
44+
cd pages_repo
45+
git add tkoi/
46+
git diff --cached --quiet || git commit -m "Auto-deploy tkoi docs from commit ${{ github.sha }}"
47+
git push
48+
cd ..
49+
rm -rf pages_repo

0 commit comments

Comments
 (0)