基于时间自动构建Jekyll/Github Pages [英] Automating Jekyll/Github Pages builds based on time
问题描述
我正在一个项目中,我只列出当前日期(今天)的帖子. 最好让Github(或其他工具)每天在午夜00:00重建站点.
I am working on a project where I list only posts with current date(today). It would be great to have Github(or some other tool) rebuild the site every day at midnight 00:00.
任何人都可以告诉我如何通过Github或任何其他工具来完成此操作吗? Travis CI也许?任何教程或示例都将不胜感激,因为我对此很陌生.
Can anyone please tell me how this can be done via Github or any other tools? Travis CI maybe? Any tutorials or examples would be much appreciated as i am very new to this.
推荐答案
在Github存储库中拥有主分支和 gh-pages 分支以使用 Github页面,
Have a master branch and a gh-pages branch in a Github repo to use Github pages,
然后创建一个 Travis Cron Job 每天执行部署脚本.(由@建议戈里尔)
Then create a Travis Cron Job to execute the deployment script on a daily basis.(as suggested by @Gorille) so it
- 获取master分支的内容,并使用
jekyll build
命令生成网站 - 将生成的网站推送到 gh-pages 分支.
- takes the content of the master branch and generate the site with
jekyll build
command - push the generated site to the gh-pages branch.
这篇关于基于时间自动构建Jekyll/Github Pages的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!