This commit is contained in:
MeysamMoghaddam
2025-10-07 20:53:28 +03:30
parent ba5d3110a0
commit 0042726cdb
11 changed files with 56 additions and 16 deletions

View File

@@ -0,0 +1,46 @@
name: Push nuget and docker image Actions Workflow
on:
push:
branches:
- stage
jobs:
Deploy:
runs-on: windows
steps:
- name: Checkout
uses: https://git.afrino.co/actions/checkout@v3
- name: Setup dotnet
uses: https://git.afrino.co/actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Remove Package Source
run: dotnet nuget remove source FourSat
continue-on-error: true
- name: Add Package Source
run: dotnet nuget add source --name FourSat --username systemuser --password sZSA7PTiv3pUSQZ https://git.afrino.co/api/packages/FourSat/nuget/index.json --store-password-in-clear-text
- name: Install dependencies
run: dotnet restore ".\src\BackOffice.BFF.WebApi\BackOffice.BFF.WebApi.csproj"
- name: Build
run: dotnet build ".\src\BackOffice.BFF.WebApi\BackOffice.BFF.WebApi.csproj" --configuration Release --no-restore
- name: Test
run: dotnet test ".\src\BackOffice.BFF.WebApi\BackOffice.BFF.WebApi.csproj" --no-restore --verbosity normal
- name: Recycle Apppool
run: |
& "C:\Windows\System32\inetsrv\appcmd.exe" recycle apppool /apppool.name:bogw.kbs1.ir
shell: powershell
- name: Stop Website
run: |
& "C:\Windows\System32\inetsrv\appcmd.exe" stop site /site.name:bogw.kbs1.ir
shell: powershell
- name: Publish
run: dotnet publish ".\src\BackOffice.BFF.WebApi\BackOffice.BFF.WebApi.csproj" -c Release -o publish
- name: Copy Publish To IIS Directory
run: Get-ChildItem -Path "publish\*" | Copy-Item -Destination "E:\kbs1.ir\bogw.kbs1.ir\" -Recurse -Force
- name: Start Website
run: |
& "C:\Windows\System32\inetsrv\appcmd.exe" start site /site.name:bogw.kbs1.ir
shell: powershell