-
Notifications
You must be signed in to change notification settings - Fork 19
44 lines (39 loc) · 1.33 KB
/
dotnet-core.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: .NET Core deploy to GitHub pages
env:
dotnet_version: 8.0.x
project_name: "TestProject_ClientSide/TestProject_ClientSide.csproj"
base_href: /Blazor.Diagrams/
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.dotnet_version }}
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Publish
run: dotnet publish ${{ env.project_name }} -c Release -o app/publish
- name: Rewrite base href
uses: SteveSandersonMS/ghaction-rewrite-base-href@v1
with:
html_path: app/publish/wwwroot/index.html
base_href: ${{ env.base_href }}
- name: add .nojekyll
run: touch app/publish/wwwroot/.nojekyll
- name: write git commit id
run: echo -n "${GITHUB_SHA}" > app/publish/wwwroot/commit.txt
- name: Deploy to Github Pages
uses: JamesIves/[email protected]
with:
token: ${{ secrets.ACCESS_TOKEN }}
branch: gh-pages # The branch the action should deploy to.
folder: app/publish/wwwroot # The folder the action should deploy.
single-commit: true