Skip to content

Commit 9c1bec1

Browse files
committed
Adding document GitHub action
1 parent 67a3a8e commit 9c1bec1

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/workflows/document.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
paths: ["R/**"]
6+
7+
name: document.yaml
8+
9+
permissions: read-all
10+
11+
jobs:
12+
document:
13+
runs-on: ubuntu-latest
14+
env:
15+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16+
permissions:
17+
contents: write
18+
steps:
19+
- name: Checkout repo
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Setup R
25+
uses: r-lib/actions/setup-r@v2
26+
with:
27+
use-public-rspm: true
28+
29+
- name: Install dependencies
30+
uses: r-lib/actions/setup-r-dependencies@v2
31+
with:
32+
working-directory: RcppTskit
33+
extra-packages: any::roxygen2
34+
needs: roxygen2
35+
36+
- name: Document
37+
run: setwd("RcppTskit"); roxygen2::roxygenise()
38+
shell: Rscript {0}
39+
40+
- name: Commit and push changes
41+
run: |
42+
git config --local user.name "$GITHUB_ACTOR"
43+
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
44+
git add man/\* NAMESPACE DESCRIPTION
45+
git commit -m "Update documentation" || echo "No changes to commit"
46+
git pull --ff-only
47+
git push origin

0 commit comments

Comments
 (0)