-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
38 lines (26 loc) · 867 Bytes
/
deploy.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
#!/usr/bin/env sh
# 确保脚本抛出遇到的错误
set -e
# 生成静态文件
npm run docs:build
Cur_Dir=$(pwd)
echo $Cur_Dir
# 进入生成的文件夹
cd docs/.vuepress/dist
Cur_Dir=$(pwd)
echo $Cur_Dir
# 如果是发布到自定义域名
# echo 'www.example.com' > CNAME
git init
git config --global user.email 15035806407@163.com
git config --global user.name chaijinsong
git config --global user.password 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
git add .
git commit -m 'deploy'
git remote add origin https://github.com/chaijinsong/chaijinsong.github.io.git
# 如果发布到 https://<USERNAME>.github.io
git push --set-upstream origin master
# git push -f https://github.com/chaijinsong/chaijinsong.github.io.git master
# 如果发布到 https://<USERNAME>.github.io/<REPO>
# git push -f git@github.com:<USERNAME>/<REPO>.git master:gh-pages
cd -