Skip to content

Commit 8397b9e

Browse files
committed
update workflow
1 parent 8c01d5a commit 8397b9e

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

.github/workflows/docs.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,21 @@ jobs:
1616
- name: Setup Node.js
1717
uses: actions/setup-node@v3
1818
with:
19-
node-version: '18'
19+
node-version: '16'
2020

21-
- name: Install dependencies
21+
- name: Install and patch gitbook
2222
run: |
23-
npm init -y
24-
npm install honkit --save-dev
25-
npm install web-streams-polyfill --save-dev
26-
npm install
23+
npm install -g gitbook-cli
24+
cd /usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules
25+
sed -i 's/fs.stat = statFix(fs.stat)/\/\/fs.stat = statFix(fs.stat)/' graceful-fs/polyfills.js
26+
sed -i 's/fs.fstat = statFix(fs.fstat)/\/\/fs.fstat = statFix(fs.fstat)/' graceful-fs/polyfills.js
27+
sed -i 's/fs.lstat = statFix(fs.lstat)/\/\/fs.lstat = statFix(fs.lstat)/' graceful-fs/polyfills.js
28+
cd -
29+
gitbook install
2730
2831
- name: Build documentation
2932
run: |
30-
node -e "global.ReadableStream = require('web-streams-polyfill').ReadableStream" -e "require('honkit').build()"
33+
gitbook build
3134
3235
- name: Deploy to GitHub Pages
3336
uses: peaceiris/actions-gh-pages@v3

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
"version": "1.0.0",
44
"description": "GoBatch Documentation",
55
"scripts": {
6-
"serve": "node -e \"global.ReadableStream = require('web-streams-polyfill').ReadableStream\" -e \"require('honkit').serve()\"",
7-
"build": "node -e \"global.ReadableStream = require('web-streams-polyfill').ReadableStream\" -e \"require('honkit').build()\""
6+
"serve": "gitbook serve",
7+
"build": "gitbook build"
88
},
99
"devDependencies": {
10-
"honkit": "^4.0.0",
11-
"web-streams-polyfill": "^3.2.1"
10+
"gitbook-cli": "^2.3.2"
1211
}
1312
}

0 commit comments

Comments
 (0)