-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (46 loc) · 1.86 KB
/
back-deploy.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
name: Publish, Test, and Migrate to SmarterASP.NET
on:
push:
branches:
- master
paths:
- 'back/**'
jobs:
build_and_deploy:
name: Build, Test, Migrate, and Deploy to SmarterASP.NET
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Install Entity Framework Core CLI
run: dotnet tool install --global dotnet-ef --version 8.0.1
- name: Restore dependencies
run: dotnet restore ./back/MB.API/MB.API.csproj
- name: Run API Tests
run: dotnet test ./back/MB.API.Tests/MB.API.Tests.csproj
- name: Run Application Tests
run: dotnet test ./back/MB.Application.Tests/MB.Application.Tests.csproj
- name: Run Domain Tests
run: dotnet test ./back/MB.Domain.Tests/MB.Domain.Tests.csproj
- name: Run Infrastructure Tests
run: dotnet test ./back/MB.Infrastructure.Tests/MB.Infrastructure.Tests.csproj
- name: Run Persistence Tests
run: dotnet test ./back/MB.Persistence.Tests/MB.Persistence.Tests.csproj
- name: Publish .NET project
run: dotnet publish ./back/MB.API/MB.API.csproj -c Release -o ./publish
- name: Apply EF Core Migrations
run: dotnet ef database update --project ./back/MB.Persistence/MB.Persistence.csproj
env:
ConnectionStrings__DB: ${{ secrets.PRODUCTION_CONNECTION_STRING }}
- name: Deploy to SmarterASP.NET
uses: aarhusit/deploy@main
with:
csproj-filepath: ${{ secrets.PROJECT }}
website-name: ${{ secrets.IIS_APP_NAME }}
server-computer-name: ${{ secrets.MSDEPLOY_SERVICE_URL }}
server-username: ${{ secrets.IIS_USER }}
server-password: ${{ secrets.IIS_PASSWORD }}