Lessons learned while automating Jekyll Site Deployment
Create your jekyll site:
On the server create the git repo and install ruby
Create the folders and files for nginx
Certbot messed up the nginx config, you will need to look at your default config and correct it.
Clone Git Repo to local folder.
Setup githook
In the script called by the githook the actual magic happens
And that’s it.
The important part is the third line, it clears some variables and makes the git command work. Without this line, the directory is not recognized as a git repo.
You can edit your site localy and debug it, using the command
when you are happy, commit your changes and push them, then the post-update hook will take care of the update.
The only caveat is updates to the build script take two pushes to take effect.