Skip to content

Commit 56ef048

Browse files
committed
CI: automatically update jsapi docs
Use a GitHub Action to keep the docs updated, the current onces are 14 month old and outdated. Use latest jsdoc package Add full URL to LuCI.html file in README.md Ignore generated HTML files via .gitignore Signed-off-by: Paul Spooren <mail@aparcar.org>
1 parent c1f972d commit 56ef048

4 files changed

Lines changed: 40 additions & 2 deletions

File tree

.github/workflows/jsdoc.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: GitHub pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
15+
- name: Install
16+
run: npm install
17+
18+
- name: Build
19+
run: npm run doc
20+
21+
- name: Archive docs as artifact
22+
uses: actions/upload-artifact@v2
23+
with:
24+
name: docs
25+
path: ./docs/
26+
27+
- name: Deploy
28+
uses: peaceiris/actions-gh-pages@v3
29+
with:
30+
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
31+
publish_dir: ./docs/

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ modules/luci-base/src/jsmin
1212
modules/luci-base/src/contrib/lemon
1313
modules/luci-base/src/plural_formula.c
1414
modules/luci-base/src/plural_formula.h
15+
docs/jsapi/*
16+
!docs/jsapi/README.md

docs/jsapi/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# LuCI client side API documentation
2+
3+
You can browse the JavaScript apis provided by LuCI here. A good starting point
4+
is the central [luci.js class](https://openwrt.github.io/luci/jsapi/LuCI.html).
5+

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"doc": "LC_ALL=C jsdoc -c jsdoc.conf.json -t node_modules/jaguarjs-jsdoc"
44
},
55
"devDependencies": {
6-
"jsdoc": "^3.6.3",
7-
"jaguarjs-jsdoc": "^1.1.0"
6+
"jaguarjs-jsdoc": "^1.1.0",
7+
"jsdoc": "^3.6.7"
88
}
99
}

0 commit comments

Comments
 (0)