-
-
Notifications
You must be signed in to change notification settings - Fork 160
43 lines (33 loc) · 1022 Bytes
/
dotnetcore-iis.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
name: .NET Core Deploy to IIS
on:
# push:
# branches:
# - "self-hosted"
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.0.100
# dotnet build and publish
- name: Build with dotnet
run: dotnet build --configuration Release .\dotnet-core-webapp
- name: dotnet publish
run: |
dotnet publish -c Release -o dotnetcorewebapp .\dotnet-core-webapp
- name: Deploy to IIS
run: |
iisreset /stop
Copy-Item ./dotnetcorewebapp/* C:/inetpub/wwwroot/dotnetcore-webapp -Recurse -Force
iisreset /start
- name: Curl the website as a smoke test
run: curl http://localhost/dotnetcore-webapp
- name: Run Web Test
run: |
dotnet build --configuration Release .\dotnet-core-webapp.webtest
cd .\dotnet-core-webapp.webtests
dotnet test