1 Star 0 Fork 65

世界尽头 / blog

forked from turnon / blog 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
deploy.sh 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
turnon 提交于 2023-02-13 09:37 . feat: 调整构建
#!/usr/bin/env sh
# ------------------------------------------------------------------------------
# gh-pages 部署脚本
# @author Dunwu
# @since 2020/2/10
# ------------------------------------------------------------------------------
# 装载其它库
ROOT_DIR=$(
cd $(dirname $0)
pwd
)
# 确保脚本抛出遇到的错误
set -e
# 生成静态文件
npm install
npm run build
# 进入生成的文件夹
cd ${ROOT_DIR}/.temp
# 如果是发布到自定义域名
# echo 'www.example.com' > CNAME
if [[ ${GITHUB_TOKEN} && ${GITEE_TOKEN} ]]; then
msg='自动部署'
GITHUB_URL=https://dunwu:${GITHUB_TOKEN}@github.com/dunwu/blog.git
GITEE_URL=https://turnon:${GITEE_TOKEN}@gitee.com/turnon/blog.git
git config --global user.name "dunwu"
git config --global user.email "forbreak@163.com"
else
msg='手动部署'
GITHUB_URL=git@github.com:dunwu/blog.git
GITEE_URL=git@gitee.com:turnon/blog.git
fi
git init
git add -A
git commit -m "${msg}"
# 推送到github gh-pages分支
git push -f "${GITHUB_URL}" master:gh-pages
#由于仓库容量超出gitee限制,停止push
#git push -f "${GITEE_URL}" master:gh-pages
rm -rf ${ROOT_DIR}/.temp
JavaScript
1
https://gitee.com/per_xucy/blog.git
git@gitee.com:per_xucy/blog.git
per_xucy
blog
blog
master

搜索帮助