I have my site almost done and it’s working great on the DEV URL. Currently, my workflow is:
- Write on my local machine
- create zip of
- SFTP to webserver, unzip, etc…
I have a VPS I host other things on, and would like to host my site on the same server. I have my Hugo source checked into GitHub. Is there a way to automatically rebuild/refresh my site (on the VPS) on every commit to master (on GitHub)?
So far, my ideas are:
hugolocally, push rendered HTML to separate repo. Use GitHub to trigger webhook to Caddy server (example here).
hugolocally, push rendered HTML to separate repo. Create cronjob on server to run
- Run a webhook server on the VPS. Use GitHub to trigger webhook to run custom script that runs
git pull && hugoon the server (example here).
So far, I think the third option is the best. I’d be open to any ideas. Thanks!