hexo 部署到云服务器
2022-04-23 19:40:24
# 指南
1 | git init --bare [你的仓库名称] |
进入这个仓库目录的hooks文件夹下,创建一个新文件,名称为 post-receive
1 | vim [你的仓库路径]/hooks/post-receive |
写入以下内容
1 | git --work-tree=[你的博客站点路径,hexo 生成的 html 文件会存储到这里] --git-dir=[你的仓库路径] checkout -f |
保存后退出,赋予权限
1 | chmod +x [你的仓库路径]/hooks/post-receive |
2. 配置中填写部署的地址
在 _config.yml中填写自己服务器仓库地址
1 | deploy: |
3. 最后
将nginx或Apache的站点路径指向对应的博客目录即可完成访问