-
Notifications
You must be signed in to change notification settings - Fork 19
45 lines (40 loc) · 1.41 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
45
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@v3
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/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BASE_BRANCH: main # The branch the action should deploy from.
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: app/publish/wwwroot # The folder the action should deploy.
SINGLE_COMMIT: true