-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (34 loc) · 1.12 KB
/
Copy pathdotnet.yml
File metadata and controls
38 lines (34 loc) · 1.12 KB
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
name: build-and-deploy
on:
push:
branches:
- master
paths:
- 'src/**'
jobs:
build-and-publish:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Publish
run: dotnet publish ./src/SoftCraft.HttpApi.Host/SoftCraft.HttpApi.Host.csproj --configuration Release
migrate-and-deploy:
name: Migrate and Deploy
needs: "build-and-publish"
runs-on: self-hosted
steps:
- name: Migrate and Deploy
run: |
Stop-WebAppPool -Name soft-craft-api
Stop-IISSite -Name soft-craft-api -Confirm:$false
cd ./src/SoftCraft.DbMigrator/bin/Release/net6.0/
./SoftCraft.DbMigrator.exe
cd ../../../../..
Copy-Item ./src/SoftCraft.HttpApi.Host/bin/Release/net6.0/publish/* C:/inetpub/wwwroot/soft-craft-api -Recurse -Force
Start-WebAppPool -Name soft-craft-api
Start-IISSite -Name soft-craft-api
Remove-Item .\* -Force -Recurse