-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathdeploy.sh
42 lines (35 loc) · 1.19 KB
/
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
39
40
41
42
#!/usr/bin/env sh
# 确保脚本抛出遇到的错误
set -e
# 生成静态文件
npm run build
# 进入生成的文件夹
cd docs/.vuepress/dist
# deploy to github
#echo 'b.miluluyo.github.io' > CNAME
if [ -z "$VDOING" ]; then
msg='deploy'
[email protected]:miluluyo/vdoingBlog.git
else
msg='来自 github actions的自动部署'
githubUrl=https://miluluyo:${VDOING}@github.com/miluluyo/vdoingBlog.git
git config --global user.name "miluluyo"
git config --global user.email "[email protected]"
fi
git init
git add -A
git commit -m "${msg}"
git push -f $githubUrl master:gh-pages # 推送到github
#git push -f [email protected]:miluluyo/vdoingBlog.git master:gh-pages
# deploy to coding
#echo 'www.miluluu.com\miluluu.com' > CNAME # 自定义域名
#if [ -z "$CODING_TOKEN" ]; then # -z 字符串 长度为0则为true;$CODING_TOKEN来自于github仓库`Settings/Secrets`设置的私密环境变量
# [email protected]:miluluu/miluluu.git
#else
# codingUrl=https://miluluu:${CODING_TOKEN}@e.coding.net/miluluu/miluluu/miluluu.git
#fi
#git add -A
#git commit -m "${msg}"
#git push -f $codingUrl master # 推送到coding
cd - # 退回开始所在目录
rm -rf docs/.vuepress/dist