c# - 在 github 页面上尝试使用 github 操作部署 Blazor(操作失败,并显示“ENOENT:没有这样的文件或目录,scandir)
问题描述
我已经按照本教程https://www.meziantou.net/publishing-a-blazor-webassembly-application-to-github-pages.htm并在 github 的过程中产生了这个错误: 错误 Github Action
这是 github 操作文件:
name: 'Publish application'
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the code
- uses: actions/checkout@v2
# Install .NET Core SDK
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
# Run tests
- name: Test
run: dotnet test
# DotNet restore
- name: DotNet restore
run: dotnet restore
# Generate the website
- name: Publish
run: dotnet publish GSS.MyDotNetPortfolio.Presentation/GSS.MyDotNetPortfolio.Presentation.csproj --configuration Release
# Publish the website
- name: GitHub Pages action
if: ${{ github.ref == 'refs/heads/master' }} # Publish only when the push is on master
uses: peaceiris/actions-gh-pages@v3.6.1
with:
github_token: ${{ secrets.PUBLISH_TOKEN }}
publish_branch: gh-pages
publish_dir: bin/Release/netstandard2.1/publish/wwwroot
allow_empty_commit: false
keep_files: false
force_orphan: true
# TODO uncomment the following line if you have a custom domain name
# cname: demo.meziantou.net
这是我的 .gitignore 文件: https ://github.com/guillem-soler-suetta/GSS.MyDotNetPortfolio/blob/master/.gitignore
有任何想法吗?我做了一些研究,也许是用于构建项目的块状包的问题。
谢谢。
解决方案
name: gh-pages
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.301
- name: Publish with dotnet
run: dotnet publish **projectName/projectName.csproj** --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 # The branch the action should deploy from.
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: build/wwwroot # The folder the action should deploy.
SINGLE_COMMIT: true
将项目名称更改为您的并尝试。来自一个网站,不知道是否可以在这里给出归属。它对我有用。
推荐阅读
- c# - 任务计划程序启动 .EXE 程序,该程序打开连接到数据库的网页,导致“NT 权限/匿名登录失败”
- postgresql - 关系模式和完整性约束?
- r - 如何不手动将矩形插入轴
- user-interface - 如何在 PyCharm 中运行 NGSolve GUI?
- javascript - Web自动化登录输入框麻烦
- apache - htaccess :将所有 url 重定向到公共文件夹 exept api 文件夹中的 index.php
- cmake - 如何在 cmake 中使用 cpplint.py?
- sharepoint - 自动将文件移动到文件夹时防止文件重复
- python - 按 groupby 和 mean 绘制
- javascript - 画布对象定位问题 - JS