本文针对用vuepress和github page搭建博客。其中的deploy.sh文件配置。
参考博客
----------------------开始上传------------------------
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
npm ERR! code ELIFECYCLE
npm ERR! errno 128
npm ERR! lanye233blog@1.0.0 deploy: `bash deploy.sh`
npm ERR! Exit status 128
npm ERR!
npm ERR! Failed at the lanye233blog@1.0.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
在deploy.sh中将push代码里的https地址换为ssh地址
echo "----------------------开始上传------------------------"
sudo git push -f https://github.com/xxx/xxx.github.io.git master
# git@github.com:xxx/xxx.github.io.git
# https://github.com/xxx/xxx.github.io.git
echo "----------------------上传完毕------------------------"
成功上传
----------------------开始上传------------------------
Enumerating objects: 56, done.
Counting objects: 100% (56/56), done.
Delta compression using up to 8 threads
Compressing objects: 100% (53/53), done.
Writing objects: 100% (56/56), 5.84 MiB | 208.00 KiB/s, done.
Total 56 (delta 6), reused 0 (delta 0)
remote: Resolving deltas: 100% (6/6), done.
To https://github.com/xxx/xxx.github.io.git
+ 413df59...afef7ae master -> master (forced update)
----------------------上传完毕------------------------