0
votes

Building a Firebase/Hugo static website that updates when Github repo changes.

I am using the standard theme from the Quickstart guide: https://gohugo.io/getting-started/quick-start/

The webpage runs fine locally.

hugo server -D

The webpage runs fine when I deploy build to Firebase.

firebase deploy --only hosting

The webpage does not run fine when I trigger the build from Github repo, despite Google Cloud Build saying it successfully.

  • Commit and push changes to Github repo
  • Triggers a Google Cloud Build based on the cloudbuild.yaml in Github
  • Both build steps (Hugo and Firebase) are successful

The result of visiting the URL is the following message:

Page Not Found

This file does not exist and there was no index.html found in the current directory or 404.html in the root directory.

Why am I seeing this?

You may have deployed the wrong directory for your application. Check your firebase.json and make sure the public directory is pointing to a directory that contains an index.html file.

You can also add a 404.html in the root of your site to replace this page with a custom error page.

I've tried changing the "baseURL" in config.toml to the custom domain, the firebase domain, and the Github repo URL. Nothing.

Link to the Github repo here.

4/16 Update: It works if I do not include public folder in the .gitignore

1

1 Answers

0
votes

Did you complete the CI Setup?