Featured image of post 【Hugo之路 番外1】自动构建并上传到github

【Hugo之路 番外1】自动构建并上传到github

在站点根目录下创建gogogo.bat文件,每次仅需要运行gogogo.bat即可自动构建并上传到 github

1
2
3
4
5
6
7
8
9
@echo off
set log=%DATE% %TIME%
echo %log%
hugo -D
cd public
git add .
git commit -m "%log% update"
git push -u origin main
pause

由于 ssh 上传时不时会失败,遂创建了一个push.bat文件,用于上传失败后重新上传,而不用再次生成静态文件等操作

1
2
3
4
5
6
@echo off
set log=%DATE% %TIME%
echo %log%
cd public
git push -u origin main
pause
Licensed under CC BY-NC-SA 4.0
最后更新于 Apr 01, 2022 05:31 CST
comments powered by Disqus
Built with Hugo
主题 StackJimmy 设计