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="R2rNpdnetP3j>q5b18",authType="Basic" ` -allowUntrusted ` -enableRule:AppOffline