基于Github Actions实现hexo自动化部署
这里主要介绍了博客建站的过程。 最初的想法最初建立博客的时候也是基于Hexo发布,网上关于Hexo的教程大多数都是基于github pages,也有一些是部署到个人VPS上。 对于个人而言github pages无法使用自己的域名和服务器实在浪费,同时由于本日常人使用多台电脑,如果换台机器写博客则需要重新搭建hexo环境并从部署hexo的vps拉取代码,每次都需要花很多时间在网络上,也是得不偿失。因此想到通过github存储博客代码,同时每次push的时候代码可以自动化部署到服务器上面。 方案1:WebHook第一种解决方案是基于WebHook。所谓WebHook,就概念而言可以延伸出很多东西,这里就具体例子而言。如果传统方法搭建网站,那么博客会在每天定时监测github代码是否已经更新,然后定期拉取github的代码;如果采用web hook的方法,当更新博客push到github的时候,github会通知VPS,VPS收到通知后才会去拉取代码。 Github实际上已经实现了WebHook的功能,比较麻烦的是你需要自己在VPS上写一个接口处理Github的通知,这种方法网上教程...
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick StartCreate a new post1$ hexo new "My New Post" More info: Writing Run server1$ hexo server More info: Server Generate static files1$ hexo generate More info: Generating Deploy to remote sites1$ hexo deploy More info: Deployment