在 github 工作流程中安排 firebase.json 文件的入口点

Gio*_*dze 3 firebase reactjs github-actions

React 项目旨在托管在 Firebase 托管服务上。我按照说明操作并成功部署了我想要的版本。它还询问我是否想将该项目与 Github Workflow 结合起来。这意味着它将pull我的项目main分支并merge(自动部署)到 firebase、构建并完成部署。
这里的问题是 React 文件夹位于./frontend目录中,而不是根目录中。弹出的第一个错误是:

Verifying firebase.json exists

  Error: firebase.json file not found. If your firebase.json file is not in the root of your repo, edit the entryPoint option of this GitHub action.
Run Code Online (Sandbox Code Playgroud)

屁股建议说我entrypoint...-merge.yml...pull-request.yml文件添加了变量:

Verifying firebase.json exists

  Error: firebase.json file not found. If your firebase.json file is not in the root of your repo, edit the entryPoint option of this GitHub action.
Run Code Online (Sandbox Code Playgroud)

最近出现上面的错误,说该目录不存在:

Error changing to directory /frontend: Error: ENOENT: no such file or directory, chdir '/home/runner/work/<project-name>/<project-name>' -> '/frontend'
Run Code Online (Sandbox Code Playgroud)

我希望找到frontend包含 React 项目且位于根目录中的名为的文件夹,没有错误。如何正确定位?

tho*_*idl 7

关于您应该使用的文档entryPoint而不是entrypoint. 您还可以查看Pull RequestIssue以添加该entryPoint选项。在那里您将找到有关符号的信息:

选择名称entryPoint 是为了感觉类似于工作流文件的入口点,它不适用于JS 操作,但也保持驼峰式大小写以匹配此操作的其他选项。

entrypoint使用的是docker 命令的GitHub 入口点,旨在与 Docker 容器操作一起使用,但您也可以将其与不定义任何输入的 JavaScript 操作一起使用。

另请检查您的entryPoint. 默认设置为.您的存储库的根目录。所以你应该使用./frontend而不是/frontend. 此/操作将检查您的跑步者根目录和./存储库级别上的文件夹。这里有一个例子:

$ pwd
/Users/{USER}

$ cd ./Library
$ pwd
/Users/{USER}/Library

$ cd /Library
$ pwd
/Library
Run Code Online (Sandbox Code Playgroud)