I’ve read and followed this tutorial to deploy automatically a Hugo site on a server after a git push.
When I run hugo server command in my local directory, the site render perfectly but when I check on the production server, there’s some files missing … the console output give this :
Problem 1: I don’t see in your post-receive hook anything that implies that your theme is checked out. If you use your own theme inside of the layouts folder then read on, if you are using a theme in the themes folder that you use via submodule have a look at the checked out files and verify that you don’t have your theme there. If so, your receive hook probably needs another command that checks out submodules or loads the theme however it is put into your repo.
Problem 2: @bep somewhere wrote something about parallel creation of pages. What I see from your output warnings is that you have no standard templates for pages, home and taxonomyTerms. Because the production is running in parallel on your local station it probably thinks it’s a package page and creates the files anyway. On the live server you might not have the same amount of processing capabilities and that leads to those pages missing.
Indeed, the checkout of themes folder was missing in the post-receive script.
I added a line to clone the theme from GitHub after the clone of my blog repository and the build was successfully done.
I don’t know if it’s the right way but this way can always get the last version of the theme so I think it’s cool.
Thanks!
Edit: or simpler, add the --recurse-submodules param to the git clone command in the post-receive script if the theme is a submodule.