git - 从 Github 构建 Firebase/Hugo 成功,但网站上出现索引错误
问题描述
构建一个 Firebase/Hugo 静态网站,在 Github 存储库更改时更新。
我正在使用快速入门指南中的标准主题:https ://gohugo.io/getting-started/quick-start/
该网页在本地运行良好。
hugo server -D
当我将构建部署到 Firebase 时,该网页运行良好。
firebase deploy --only hosting
当我从 Github 存储库触发构建时,该网页无法正常运行,尽管 Google Cloud Build 表示成功。
- 提交并推送更改到 Github 存储库
- 根据 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 存储库 URL。没有什么。
4/16 更新:如果我不在.gitignore 中包含公用文件夹,它可以工作
解决方案
您完成CI 设置了吗?
推荐阅读
- javascript - 如何将数据从我的节点脚本发送到客户端脚本中的函数
- angular - 试图为嵌入目的抓取站点数据而 CORS 会妨碍您吗?
- c# - 并行处理是否有助于在 c# 中更快地执行 async-await 代码?
- react-native - 获取下一页数据时出现平面列表错误
- python - 如何切出某些行和列,然后只取 Dataframe Python 中的剩余数据?
- python - 如何将十六进制字符串转换为列表中的十六进制值块?
- angular - 手动将 Angular 应用部署到 Azure 应用服务
- amazon-web-services - AWS lambda 无法承担由 cloudformation 触发的角色
- mysql - 结合mongodb和mysql数据查看
- excel - 将整行设置为范围变量类型时出现运行时错误 13