簡體   English   中英

React-app 部署到 Github 頁面 - 構建成功但部署失敗

[英]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選項卡,找到最后的部署,然后Re-run all jobs ,它應該可以工作。 這個我自己試過,成功了!

如果這對任何人都不起作用,我會保留最后一個答案。

我遇到了同樣的問題,但這沒有用,重新運行舊部署使用相同的代碼並且沒有我的更改。 我從 github Actions 選項卡中刪除了所有工作流程,然后再次推送觸發了一個新的有效部署。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM