I'm in the process of building a Hugo site, and I'm at the point where I'm looking for deployment options.<p>My assumption was that I'd mostly be looking at fancy ways of just pushing my /public folder to a server. I run Hugo commands locally, maybe I push to a git repo, and that triggers a push of my public folder.<p>Instead, I'm typically being instructed to .gitignore my /public folder, push everything to a server (sometimes via a git repo), and then allow the server to run it's own build command and then deploy?<p>Can someone help me understand the benefits of building the static site on the server as well? Certainly it can't just be for URLs because that seems like a problem solved easier in other ways.
Are you being instructed to push your repo to a build server and have it run Hugo and deploy the public folder to your webserver? That seems very reasonable. If you are being told to push your repo to the web server to have it do the build then that seems like a bad idea.<p>For what it is worth, we use Hugo to build a public folder (build done in the cloud) that we deploy to a versioned tree on our web servers. When the build and deploy is done, we update the path that is being served. We tend to keep 3 releases handy so falling back is again just a simple webserver config change.
They don't need to be, but many people find it convenient (e.g. to not have to keep a local environment on multiple computers, to trigger builds from other services, ...), thus the services offer it as an option.