-
Notifications
You must be signed in to change notification settings - Fork 5
67 lines (50 loc) · 1.55 KB
/
main.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
name: CI/CD Pipeline
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
jobs:
build:
runs-on: windows-latest
steps:
- name: Kodni yuklash
uses: actions/checkout@v3
- name: .NETni o'rnatish
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x' # .NET 8 versiyasini ishlatish
- name: Dependensiyalarni tiklash
run: dotnet restore
- name: Loyihani yig'ish (build)
run: dotnet build --no-restore --configuration Release
- name: Testlarni ishga tushirish
run: dotnet test --no-build --verbosity normal
deploy:
runs-on: windows-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- name: Kodni yuklash
uses: actions/checkout@v3
- name: .NETni o'rnatish
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: IIS serverga deploy qilish
run: |
echo IIS serverga deploy qilinmoqda...
# IIS App Pool'ni to'xtatish
#Stop-WebAppPool -Name 'DefaultAppPool'
# Web-saytni to'xtatish
#Stop-Website -Name 'Default Web Site'
# API'ni IIS serverga publish qilish
#dotnet publish ./UrphaCapital.API/UrphaCapital.API.csproj -c Release -o 'C:\inetpub\wwwroot\UrphaCapital'
# IIS App Pool'ni qayta ishga tushirish
#Start-WebAppPool -Name 'DefaultAppPool'
# Web-saytni qayta ishga tushirish
#Start-Website -Name 'Default Web Site'