问题
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.
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.
回答1:
Have a master branch and a gh-pages branch in a Github repo to use Github pages,
Then create a Travis Cron Job to execute the deployment script on a daily basis.(as suggested by @Gorille) so it
- takes the content of the master branch and generate the site with
jekyll build
command - push the generated site to the gh-pages branch.
回答2:
You may use travis cron job : https://docs.travis-ci.com/user/cron-jobs/
This way you can rebuild your site daily. Please beware that you cannot precisely control the hour. I of course assume that you know how to build the site.
来源:https://stackoverflow.com/questions/42335256/automating-jekyll-github-pages-builds-based-on-time