43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
name: Deploy Development ASP.NET Core App to IIS
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
|
|
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
|
|
|
|
- name: Build
|
|
run: dotnet build --configuration Release
|
|
|
|
- name: Publish
|
|
run: dotnet publish --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://185.208.175.186:8172/msdeploy.axd?site=gozareshgir",userName="deployUser",password="As@D3eP%L%oYU$ser",authType="Basic" `
|
|
-allowUntrusted `
|
|
-enableRule:AppOffline
|
|
|
|
|