-
Notifications
You must be signed in to change notification settings - Fork 25
78 lines (59 loc) · 1.89 KB
/
CI.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET 5.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Setup .NET 7.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Publish NTypewriter.Online
run: dotnet publish NTypewriter.Online/NTypewriter.Online.csproj -c Release -o publish --nologo
- name: Upload artifact NTypewriterOnlinePublished
uses: actions/[email protected]
with:
name: NTypewriterOnlinePublished
path: publish
- name: Test
run: dotnet test --no-build --verbosity normal
deploy:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download artifact NTypewriterOnlinePublished
uses: actions/[email protected]
with:
name: NTypewriterOnlinePublished
# changes the base-tag in index.html from '/' to 'NTypewriter' to match GitHub Pages repository subdirectory
- name: Change base-tag in index.html from / to NTypewriter
run: sed -i 's/<base href="\/" \/>/<base href="\/NTypewriter\/" \/>/g' wwwroot/index.html
- name: Deploy publish/wwwroot to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: wwwroot