[英]React-app deployment to Github Pages - Build Successful but deploy failed
最初,我将我的 React 应用程序(使用 create-react-app 创建)部署到 Github 页面,它运行良好。 但是,在对src
文件进行一些更改后,我想更新网站,因此我决定使用npm run deploy
重新部署该应用程序,并在命令末尾打印Published
完成。 在 Github 上,操作显示构建成功,但无法部署,给我一个错误代码 400。
来自Github的完整错误日志如下:
Actor: github-pages[bot]
Action ID: 1996792679
Artifact URL: https://pipelines.actions.githubusercontent.com/P4vIRQYdOzrk38NoGmJNrF5GvwW7S92VAUyJNinMXyLtZzPbIB/_apis/pipelines/workflows/1996792679/artifacts?api-version=6.0-preview
{"count":1,"value":[{"containerId":354579,"size":3092480,"signedContent":null,"fileContainerResourceUrl":"https://pipelines.actions.githubusercontent.com/P4vIRQYdOzrk38NoGmJNrF5GvwW7S92VAUyJNinMXyLtZzPbIB/_apis/resources/Containers/354579","type":"actions_storage","name":"github-pages","url":"https://pipelines.actions.githubusercontent.com/P4vIRQYdOzrk38NoGmJNrF5GvwW7S92VAUyJNinMXyLtZzPbIB/_apis/pipelines/1/runs/2/artifacts?artifactName=github-pages","expiresOn":"2022-06-15T05:21:40.7473658Z","items":null}]}
Creating deployment with payload:
{
"artifact_url": "https://pipelines.actions.githubusercontent.com/P4vIRQYdOzrk38NoGmJNrF5GvwW7S92VAUyJNinMXyLtZzPbIB/_apis/pipelines/1/runs/2/artifacts?artifactName=github-pages&%24expand=SignedContent",
"pages_build_version": "8e6a4594c3e946a3f32ab67af68f527ec66ffc90",
"oidc_token": "***"
}
Failed to create deployment for 8e6a4594c3e946a3f32ab67af68f527ec66ffc90.
{"message":"Deployment request failed for 8e6a4594c3e946a3f32ab67af68f527ec66ffc90 due to in progress deployment. Please cancel c1852e5059b99567d48405d0610990fdc25f0946 first or wait for it to complete.","documentation_url":"https://docs.github.com/rest/reference/repos#create-a-github-pages-deployment"}
Error: Error: Request failed with status code 400
Error: Error: Request failed with status code 400
Sending telemetry for run id 1996792679
我对错误是什么感到非常困惑,在部署到 Gh Pages 之前,有没有人反驳过 400 错误代码?
附加说明:如果您需要任何其他信息,请在下面发表评论,因为这是我第一次将 React 应用程序部署到 github 页面,所以我很乐意帮助您帮助我
更新
您可以在此处访问 github 存储库: cynclar.github.io
我还没有找到解决方案,但我有一个解决方法。 如果您 go 在“ Actions
”选项卡中运行的最后一个工作流程(寻找绿色复选标记),您可以单击“ Re-run all jobs
”,这应该会为您部署您的网页,包括最新的更改。
希望这暂时有效,直到有更好的解决方案!
我遇到了同样的问题,但这没有用,重新运行旧部署使用相同的代码并且没有我的更改。 我从 github Actions 选项卡中删除了所有工作流程,然后再次推送触发了一个新的有效部署。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.