Files
Backend-Api/.github/workflows/dotnet-developPublish.yml
2025-12-23 15:14:15 +03:30

42 lines
1.2 KiB
YAML

name: Deploy Development ASP.NET Core App to IIS
on:
push:
branches:
- Main
env:
DOTNET_ENVIRONMENT: Development
jobs:
build-and-deploy:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: dotnet restore ServiceHost/ServiceHost.csproj
- name: Build
run: dotnet build ServiceHost/ServiceHost.csproj --configuration Release
- name: Publish
run: dotnet publish ServiceHost/ServiceHost.csproj --configuration Release --output ./publish /p:EnvironmentName=Development --no-build
- name: Deploy to IIS via Web Deploy
shell: powershell
run: |
$publishFolder = Resolve-Path ./publish
& "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" `
-verb:sync `
-source:contentPath="$publishFolder" `
-dest:contentPath="dadmehrg",computerName="https://171.22.24.15:8172/msdeploy.axd?site=dadmehrg",userName="Administrator",password="R",authType="Basic" `
-allowUntrusted `
-enableRule:AppOffline