Automatically building a Jekyll blog on Hostwinds VPS?


#1

How can I do this? I would like it to build the site like it does on Github Pages whenever a change is made.

Thanks


#2

You can probably do this with Github webhooks, although the detail depend a lot on the server-side stack. More info:


#3

I’m not sure how this would work. Can I not set up the server to build the site?

Thanks


#4

I think that is what he is saying the webhook helps with. How are you going to do changes on the server? by committing code to GH? or by making changes on the server directly?


#5

Via FTP into the server


#6

ah - maybe gulp could be running to monitor that folder and on change it rebuilds the site.

I use gulp in development to do this very thing, works great.

Maybe this will help - mostly about using gulp for asset processing, but the gulp task itself would do what you want I think:

https://rdyar.github.io/2017/10/01/speed-up-jekyll-by-using-gulp-for-sass-and-other-assets/


#7

Thanks, I’ll take a look!


#8

course it assumes your vps allows you to install things and do that. Which may not be the case.


#9

Sorry, I though you already had your server setup to build the site and just wanted advice on automating the process. Here is the full setup you would need in summary:

  • Setup server with necessary tools to update and build site (git, ruby, jekyll, etc.)
  • Clone the site repo to the server (optionally do manual test builds with Jekyll)
  • Add a webhook end-point script (written in CGI, PHP, or whatnot) to receive a POST from Github and then update and build the site (i.e. basically running something like git pull && jekyll build)
  • Setup a webhook on Github to post to the end-point on server.

After that, a push to Github will trigger the end-point script on the server causing it to pull new changes from Github and rebuild the site. Of course, there are many detail that depend on the specifics of the VPS’s OS, web server, etc.