forked from huweihuang/linux-notes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·36 lines (29 loc) · 759 Bytes
/
deploy.sh
File metadata and controls
executable file
·36 lines (29 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# run in MASTER_DIR
set -x
set -e
MESSAGE=$1
PROGRAM="linux"
GITBOOK_DIR="/Users/weihuanghu/hexo/gitbook"
MASTER_DIR="${GITBOOK_DIR}/${PROGRAM}-notes"
GHPAGE_DIR="${GITBOOK_DIR}/${PROGRAM}-gh-pages"
# CODING_DIR="${GITBOOK_DIR}/${PROGRAM}-coding-pages"
# build
gitbook build
# clean GHPAGE_DIR
rm -fr ${GHPAGE_DIR}/*
# rm -fr ${CODING_DIR}/*
# copy _book to GHPAGE_DIR
cp -fr ${MASTER_DIR}/_book/* ${GHPAGE_DIR}
cp -fr ${MASTER_DIR}/README.md ${GHPAGE_DIR}
# cp -fr ${MASTER_DIR}/_book/* ${CODING_DIR}
# cp -fr ${MASTER_DIR}/README.md ${CODING_DIR}
# git commit
cd ${GHPAGE_DIR}
git add --all
git commit -m "${MESSAGE}"
git push origin gh-pages
# cd ${CODING_DIR}
# git add --all
# git commit -m "${MESSAGE}"
# git push origin coding-pages