Updated At 2021.03.15
⚠️ 目前这种方式不再被推荐使用了。你应该使用 Github Actions 部署你的静态项目。
参考 Vuepress 部署这一节:
以主页为例,在项目根目录下添加 deploy.sh
,填入以下内容:
#!/usr/bin/env sh
set -e
npm run build
cd dist
echo 'varzy.me' > CNAME
git init
git add -A
git commit -m 'deploy'
git push -f [email protected]:varzy/varzy.github.io.git master
cd -
在 package.json
中添加命令:
"scripts": {
"deploy": "bash deploy.sh"
},