blazor - 无法部署到 Github 页面 - 使用 GitHub 操作的 Blazor webassembly

标签 blazor github-actions

我想我已经按照所有步骤使用我从 https://www.davideguida.com/how-to-deploy-blazor-webassembly-on-github-pages-using-github-actions/ 找到的 GitHub 操作在 GitHub 页面上部署 Blazor webassembly。
但它在 Deploy to Github Pages 处失败了步

  • 设置作业(通过)
  • 运行操作/checkout@v2(通过)
  • 设置 .NET Core(通过)
  • 使用 dotnet 发布(已通过)
  • 部署到 Github 页面(失败)
  • 运行后操作/checkout@v2(通过)
  • 完成作业(通过)

  • 以下是错误说明
        ❓ FAQ/Wiki: https://github.com/JamesIves/github-pages-deploy-action/wiki
        🔧 Support: https://github.com/JamesIves/github-pages-deploy-action/issues
        ⭐ Contribute: https://github.com/JamesIves/github-pages-deploy-action/blob/dev/CONTRIBUTING.md
        
        Maintained by James Ives (https://jamesiv.es)
    Checking configuration and starting deployment… 🚦
    Deploying using …… 🔑
    Configuring git…
    /usr/bin/git init
    Reinitialized existing Git repository in /home/runner/work/FirstBlazor/FirstBlazor/.git/
    /usr/bin/git config user.name ngaisteve1
    /usr/bin/git config user.email xxx@gmail.com
    /usr/bin/git remote rm origin
    /usr/bin/git remote add origin ***github.com/ngaisteve1/FirstBlazor.git
    /usr/bin/git fetch --no-recurse-submodules
    From https://github.com/ngaisteve1/FirstBlazor
     * [new branch]      master     -> origin/master
    Git configured… 🔧
    Starting to commit changes…
    /usr/bin/git ls-remote --heads ***github.com/ngaisteve1/FirstBlazor.git master | wc -l
    136e7850750d3861e72a15355289952f94777c9b    refs/heads/master
    /usr/bin/git checkout --progress --force development
    error: pathspec 'development' did not match any file(s) known to git
    Running post deployment cleanup jobs… 🗑️
    /usr/bin/git worktree remove github-pages-deploy-action-temp-deployment-folder --force
    fatal: 'github-pages-deploy-action-temp-deployment-folder' is not a working tree
    ##[error]The process '/usr/bin/git' failed with exit code 128
    Deployment failed! ❌
    
    这是我的 github 仓库 - https://github.com/ngaisteve1/FirstBlazor

    最佳答案

    您需要创建一个名为 development 的分支。来自 master分支和集合 development分支为 default在您的存储库设置中分支。
    这是因为您的 gh-pages.yml文件有 BASE_BRANCH: developmentBRANCH: master

    with:
        ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
        BASE_BRANCH: development # The branch the action should deploy from.
        BRANCH: master # The branch the action should deploy to.
        FOLDER: build/wwwroot # The folder the action should deploy.
        SINGLE_COMMIT: true
    
    这样部署将从 development 开始分支到 master分支

    关于blazor - 无法部署到 Github 页面 - 使用 GitHub 操作的 Blazor webassembly,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62734631/

    相关文章:

    blazor - 使用特定格式绑定(bind) Blazor 中的值

    postgresql - 开拓者 + 身份 : why there is an error?

    python - 使用 GitHub Actions,如何将 flake8 退出代码存储为变量而不是使工作流程失败?

    github - 在 GitHub 操作中检索已修改文件的列表

    github - 有没有办法在一个地方收集所有 Github 操作工作流结果?

    github - 在更新存储库中的某些文件时停止触发 GitHub Actions

    c# - Http GetJsonAsync 从服务器 API 返回 null

    google-chrome - 更新后在 Chrome 中无法登录 Blazor WASM

    c# - Blazor WASM : Secure a video stream - controller only accessible for authorized users

    javascript - 如何在Github中自动打开PR列表?