使用脚本在 Github Pages 部署静态页面

Mar 28, 2020#CICD

Updated At 2021.03.15

目前这种方式不再被推荐使用了。你应该使用 Github Actions 部署你的静态项目。


以主页为例,在项目根目录下添加 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" },
评论 (0)
⭡ 顶部£ 赞赏