尝试使用GitHub操作将Blazor发布到GitHub页面

尝试使用GitHub操作将Blazor发布到GitHub页面,github,github-pages,github-actions,blazor-client-side,Github,Github Pages,Github Actions,Blazor Client Side,我正在尝试使用GitHub操作将Blazor发布到GitHub页面 我用过,用过 我的main.yml: name: Build and Deploy on: [push] jobs: build-and-deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - name: Setup .NET Core uses: actions/setup-dotnet@v1

我正在尝试使用GitHub操作将Blazor发布到GitHub页面

我用过,用过

我的main.yml:

name: Build and Deploy
on: [push]
jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Setup .NET Core
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 3.1.100
    - name: Publish with dotnet
      run: dotnet publish --configuration Release --output build
    - name: Deploy to Github Pages
      uses: JamesIves/github-pages-deploy-action@releases/v3
      with:
        ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
        BASE_BRANCH: master
        BRANCH: gh-pages-people # The branch the action should deploy to.
        FOLDER: build/BlazorGame/dist # The folder the action should deploy.
        CLEAN: true
所以,它在我的主程序中编译代码,然后应该创建新的分支并在那里部署编译后的代码

我给我的分支机构“人民出版社”打了电话,结果它很好地出版了:

git开关-c gh动作温度部署分支 切换到新分支“gh action temp deployment branch” git提交-m部署到从主控56b7095f73aeb2fa7850956778934c04d3a7eac6发布的人员-安静 git push-force https://***@github.com/alexan1/BlazorGame.git gh action temp部署分支:人员发布 到https://github.com/alexan1/BlazorGame.git d2a2c28..28c546d gh action temp部署分支->人员发布
正在运行部署后清理作业 部署工作正常,但您需要满足2个条件:

首次运行操作时,将创建分支,但部署失败。您需要第二次运行操作“新建承诺”,并将其部署到已创建的分支。因为分支存在,所以部署之后可以执行的所有操作都不会出现问题。 不知道如何修复它,可能会在创建分支和部署之间增加一些延迟,但我不需要担心,因为我的问题已经解决了

为了能够从分支发布GitHub页面,分支名称应该完全是gh页面,无需任何修改


看起来您没有在github上创建gh pages people分支。@smac89,实际上它是创建的