2018-06-03 19:30:57 +08:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
|
|
|
|
|
# 确保脚本抛出遇到的错误
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
# 生成静态文件
|
2018-06-22 08:34:59 +08:00
|
|
|
npm run build
|
2018-06-03 19:30:57 +08:00
|
|
|
|
|
|
|
|
# 进入生成的文件夹
|
2018-06-22 08:34:59 +08:00
|
|
|
cd dist
|
2018-06-03 19:30:57 +08:00
|
|
|
|
|
|
|
|
# 如果是发布到自定义域名
|
|
|
|
|
# echo 'www.example.com' > CNAME
|
|
|
|
|
|
|
|
|
|
git init
|
|
|
|
|
git add -A
|
|
|
|
|
git commit -m 'deploy'
|
|
|
|
|
|
|
|
|
|
# 如果发布到 https://<USERNAME>.github.io
|
|
|
|
|
# git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git master
|
|
|
|
|
|
|
|
|
|
# 如果发布到 https://<USERNAME>.github.io/<REPO>
|
2018-06-22 08:34:59 +08:00
|
|
|
git push -f git@gitee.com:fairyever/d2-admin-preview.git master
|
2018-06-03 19:30:57 +08:00
|
|
|
|
2018-06-26 22:20:59 +08:00
|
|
|
cd -
|
|
|
|
|
|
|
|
|
|
echo "publish to https://fairyever.gitee.io/d2-admin-preview/#/index"
|