来自Github的Firebase / Hugo构建成功,但网站上出现索引错误

问题描述 投票:0回答:1

构建一个Firebase / Hugo静态网站,在Github repo更改时进行更新。

我正在使用快速入门指南中的标准主题:https://gohugo.io/getting-started/quick-start/

网页在本地运行良好。

hugo server -D

当我将构建部署到Firebase时,网页运行正常。

firebase deploy --only hosting

尽管Google Cloud Build成功说出,但当我从Github repo触发构建时,网页运行不正常。

  • 提交并推送更改为Github repo
  • 根据Github中的cloudbuild.yaml触发Google Cloud Build
  • 两个构建步骤(Hugo和Firebase)都是成功的

访问URL的结果是以下消息:

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.

我已经尝试将config.toml中的“baseURL”更改为自定义域,firebase域和Github repo URL。没有。

Link to the Github repo here.

4/16更新:如果我在.gitignore中不包含公用文件夹,则它可以正常工作

git firebase google-cloud-platform hugo google-cloud-build
1个回答
0
投票

你完成了CI Setup吗?

© www.soinside.com 2019 - 2024. All rights reserved.