Skip to content
This repository has been archived by the owner on Apr 2, 2022. It is now read-only.

Commit

Permalink
添加 github pages 发布脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
rxliuli committed Apr 18, 2019
1 parent 85b933d commit a79b378
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions CNAME
@@ -0,0 +1 @@
rx-util.rxliuli.com
22 changes: 22 additions & 0 deletions gh-pages-pub.js
@@ -0,0 +1,22 @@
// 发布文档到 git-pages
const exec = require('child_process').execSync
console.log('Start Deploy github pages...')

const cmds = [
'yarn docs',
'yarn coverage',
'cp CNAME docs/',
'git subtree push --prefix=docs origin gh-pages',
'rm -rf docs/'
]

cmds.forEach(cmd => {
try {
const stdout = exec(cmd)
console.log(stdout.toString())
} catch (err) {
console.error(err)
console.error('Deploy github pages failed')
throw err
}
})
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -14,7 +14,7 @@
"docs": "esdoc",
"test": "jest --watch",
"coverage": "jest --coverage",
"pub": "npm run build && npm run docs && npm run coverage",
"pages": "node gh-pages-pub.js",
"server": "npm run docs && npm run coverage && live-server docs/ --port=4000"
},
"repository": {
Expand Down

0 comments on commit a79b378

Please sign in to comment.