Skip to content

Commit 19dcc0f

Browse files
committed
build: create docs deployment script
1 parent 2945d98 commit 19dcc0f

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.DS_Store
2-
node_modules/
2+
node_modules
33
npm-debug.log
44
test/unit/coverage
5+
docs/.vuepress/dist

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"build": "NODE_ENV=production webpack --config scripts/webpack.config.js -p --progress --hide-modules",
1919
"docs:dev": "vuepress dev docs",
2020
"docs:build": "vuepress build docs",
21+
"docs:deploy": "bash ./scripts/deploy_docs.sh",
2122
"lint": "eslint -f friendly --ext .js,.vue ./",
2223
"test": "BABEL_ENV=test karma start scripts/karma.conf.js",
2324
"precommit": "npm run lint",

scripts/deploy_docs.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
set -e
2+
shopt -s extglob
3+
4+
TEMP_PATH="docs/.vuepress/.temp"
5+
6+
# build docs
7+
npm run docs:build
8+
9+
# prepare deploy
10+
mkdir $TEMP_PATH
11+
cd $TEMP_PATH
12+
git init
13+
git pull [email protected]:PeachScript/vue-infinite-loading.git gh-pages
14+
rm -rf ./!(old) # keep old version docs
15+
cp -r ../dist/* .
16+
17+
# commit and push changes
18+
git add -A
19+
git commit --am -m "deploy documentation"
20+
git push -f [email protected]:PeachScript/vue-infinite-loading.git master:gh-pages
21+
22+
# clean
23+
cd -
24+
rm -rf $TEMP_PATH

0 commit comments

Comments
 (0)