forked from frank-lam/fullstack-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
40 lines (26 loc) · 706 Bytes
/
Copy pathdeploy.sh
File metadata and controls
40 lines (26 loc) · 706 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
37
38
39
40
#!/usr/bin/env sh
# 确保脚本抛出遇到的错误
set -e
rm gh-pages -rf; mkdir gh-pages; cp -r notes/* gh-pages/;
cd gh-pages;
# 将子目录的所有图片全部复制到文档根目录中,解决docsify图片索引不到的问题
rm assets/ -rf
mkdir assets
rm pics/ -rf
mkdir pics
for f in $(find ../notes/ -type f -print | grep assets)
do
cp $f ./assets
done
for f in $(find ../notes/ -type f -print | grep pics)
do
cp $f ./pics
done
# 进入生成的文件夹
#创建.nojekyll 防止Github Pages build错误
touch .nojekyll
git init
git add -A
git commit -m 'deploy'
git push -f "https://${GH_TOKEN}@github.com/frank-lam/fullstack-tutorial.git" master:gh-pages
cd -