Two basic steps need to be taken to publish a static website: Build & Deploy. There are many ways to realize them.
Many workflows for Hugo are mentioned in the section Hosting & Deployment of its documentation. In all cases we need to set the parameter
baseURL to the URL of our site in the main configuration file config.yaml.
The following remarks will give you a first impression of two general ways to build & deploy.
As long as you are the only one finalizing the content, it’s easy to stick to your own computer. To generate a complete version of the site, we run Hugo in its default build mode from the project root like this:
Hugo renders the site and writes the files by default into the folder
public. You can upload its content directly to your provider. You may also transfer the files to a big provider with a Content Delivery Network (CDN) — without thinking about caching as you would for a database driven CMS. The pages are then distributed to servers all over the world and are available with minimal latency.
Special providers automate the build process with configurable virtual machines. This is very useful for teams in need of a reliable shared build environment. The provider gets access to the repository (usually Git based), automatically pulls new content and (re)builds the site. Some of them also own a CDN, which gets populated immediately afterwards.
This setup is also convenient for advanced non-commercial projects as long as commercial providers offer a free tier for personal or open-source use. Hugo is building sites so fast, you may well stay in their often generous limits.