Skip to content

Commit dcdd805

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

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,21 @@ 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+
token: ${{ secrets.GITHUB_TOKEN }}
61+
62+
- name: Publish documentation
63+
if: runner.os == 'macOS'
64+
run: |
65+
Rscript -e 'litedown::fuse_book("docs")'
66+
cd docs; cp -r *.html ../gh-pages/; cd ../gh-pages
67+
git config user.name "Yihui Xie"
68+
git config user.email "[email protected]"
69+
git add .
70+
git commit -m "update docs"
71+
git push

0 commit comments

Comments
 (0)