test deploy#2
This commit is contained in:
parent
8a78ce43f9
commit
31200e4757
13
deploy.sh
13
deploy.sh
|
|
@ -9,13 +9,14 @@ npm run build
|
||||||
# 进入生成的文件夹
|
# 进入生成的文件夹
|
||||||
cd docs/.vuepress/dist
|
cd docs/.vuepress/dist
|
||||||
|
|
||||||
# 自定义域名
|
# github
|
||||||
echo 'b.evanblogweb.com' > CNAME
|
echo 'b.evanblogweb.com' > CNAME # 自定义域名
|
||||||
|
if [ -z "$GITHUB_TOKEN" ]; then # -z 字符串 长度为0则为true
|
||||||
if [ !$GITHUB_TOKEN ]; then
|
echo '没有token'
|
||||||
msg='deploy'
|
msg='deploy'
|
||||||
githubUrl=git@github.com:xugaoyi/evanblog.git
|
githubUrl=git@github.com:xugaoyi/evanblog.git
|
||||||
else
|
else
|
||||||
|
echo '有token'
|
||||||
msg='GitHub Action deploy'
|
msg='GitHub Action deploy'
|
||||||
githubUrl=https://xugaoyi:$GITHUB_TOKEN@github.com/xugaoyi/evanblog.git
|
githubUrl=https://xugaoyi:$GITHUB_TOKEN@github.com/xugaoyi/evanblog.git
|
||||||
echo githubUrl
|
echo githubUrl
|
||||||
|
|
@ -29,12 +30,12 @@ git push -f $githubUrl master:gh-pages # 发布到github
|
||||||
|
|
||||||
# coding
|
# coding
|
||||||
echo 'evanblogweb.com\nwww.evanblogweb.com' > CNAME
|
echo 'evanblogweb.com\nwww.evanblogweb.com' > CNAME
|
||||||
git add -A
|
if [ -z "$CODING_TOKEN" ]; then
|
||||||
if [ !$CODING_TOKEN ]; then
|
|
||||||
codingUrl=git@git.dev.tencent.com:xugaoyi/xugaoyi.git
|
codingUrl=git@git.dev.tencent.com:xugaoyi/xugaoyi.git
|
||||||
else
|
else
|
||||||
codingUrl=https://xugaoyi:${CODING_TOKEN}@git.dev.tencent.com/xugaoyi/xugaoyi.git
|
codingUrl=https://xugaoyi:${CODING_TOKEN}@git.dev.tencent.com/xugaoyi/xugaoyi.git
|
||||||
fi
|
fi
|
||||||
|
git add -A
|
||||||
git commit -m $msg
|
git commit -m $msg
|
||||||
git push -f $codingUrl master # 发布到coding
|
git push -f $codingUrl master # 发布到coding
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue