Deploy Hugo site at Firebase
How-to deploy Hugo generated static site at Google Firebase service
Last updated
How-to deploy Hugo generated static site at Google Firebase service
Last updated
The following steps need to be cleared prior to follow the how-to:
Understand what Hugo SDK is and how to use it
Make ready your site public files by issuing hugo
command
A Firebase account with a project assigned to host your site
Google Firebase is a comprehensive mobile and web development platform provided by Google. Firebase provides a range of features that cover various aspects of app development, including authentication, real-time database, cloud storage, hosting, cloud functions, and more.
It is cheaper an most suitable option than GCP for personal projects.
Once logged into Firebase and launched the (first) project, please follow the next steps:
Install the CLI tool to talk with Firebase
npm install -g firebase-tools
Then we need to login
firebase login
And perform the initialization in the Hugo root working directory;
firebase init
Firebase features needed to deploy our site From here:
Choose Hosting in the feature question
Choose the project you just set up
Accept the default for your database rules file
Accept the default for the publish directory, which is public
Choose “No” in the question if you are deploying a single-page app
Now we're done to deploy our site in our Firebase project, by issuing:
firebase deploy --only hosting
If everything is fine the output looks like
Last but not least important step: https://firebase.google.com/docs/hosting/custom-domain