-
Notifications
You must be signed in to change notification settings - Fork 1
/
name_update.sh
58 lines (41 loc) · 986 Bytes
/
name_update.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# author: ghostwritten
# date: 01/06 2022
# description: deploy Github Pages
# ##############################################################################
set -o nounset
FILE_NAME="deploy"
FILE_VERSION="v1.0"
BASE_DIR="$( dirname "$( readlink -f "${0}" )" )"
if [ $# != 1 ] ; then
echo "USAGE: $0 something "
echo " e.g.: $0 update github pages"
exit 1;
fi
update=$1
#token=$2
user='Ghostwritten'
email='[email protected]'
repo="github.com/${user}/docker-docs.git"
book sm
cp -f SUMMARY.md Overview.md
sed -r -i '/序言/a\* \[目录\]\(.\/Overview\.md\)' SUMMARY.md
push_master(){
gitbook build
git add .
git commit -m "${update}"
git push origin master
}
push_gh-pages(){
cp -f Overview.md _book/README.md
cd _book
git init
git remote add origin https://${repo}
git add .
git commit -m "${update} For Github Pages"
git branch -M master
git push --force --quiet "https://${TOKEN}@${repo}" master:gh-pages
}
push_master
push_gh-pages
exit 0