Skip to content

Commit 9f5c936

Browse files
committed
publish docs automatically on GHA to the gh-pages branch
1 parent e0aa89c commit 9f5c936

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,19 @@ jobs:
5151
- uses: r-lib/actions/check-r-package@v2
5252
with:
5353
upload-snapshots: true
54+
55+
- uses: actions/checkout@v3
56+
if: runner.os == 'macOS'
57+
with:
58+
path: gh-pages
59+
ref: gh-pages
60+
61+
- name: Publish documentation
62+
if: runner.os == 'macOS'
63+
run: |
64+
Rscript -e 'litedown::fuse_book("docs")'
65+
cd docs; cp -r *.html ../gh-pages/; cd ../gh-pages
66+
git config user.name "Yihui Xie"
67+
git config user.email "[email protected]"
68+
git add .
69+
git commit -m "update docs" && git push || true

0 commit comments

Comments
 (0)