最近想申请一个新的github,来做一个静态博客。毕竟自己购买主机,搭建,很多内容未必能持久的保存下来,需要自己操心,也是成本,github活的时间估计能长一些吧。
之前看过hexo,但是是第一次接入travis ci,来进行监控和编译发布,着实调试了一下。
内容太多了。首先需要把github和travis进行关联。
我就把参考资料列在这里吧。
关键是.travis.yml中的内容,大概要懂得,从哪个分支的代码编译,发布到哪个分支。
我的是,从master的分支编译,发布到main分支。
sudo: false language: node_js node_js: - 15 cache: npm branches: only: - master script: - hexo generate deplay: provider: pages skip_cleanup: true github_token: $GH_TOKEN keep_history: true committer_from_gh: true target_branch: main on: branch: master local-dir: public
在这一步之前,还是有很多工作需要多的,放一些官方文档以及搜索出来的其他人的有帮助的博客资料在这里吧:
https://hexo.io/docs/github-pages.html
https://hexo.io/docs/one-command-deployment
https://cloud.tencent.com/developer/article/1626168
https://cloud.tencent.com/developer/article/1644065
https://blog.csdn.net/padluo/article/details/104729135
https://mfrank2016.github.io/breeze-blog/2020/05/02/hexo/hexo-start/
https://segmentfault.com/a/1190000023346633