Create dotnet-developPublish.yml

This commit is contained in:
Mahan Chamani
2025-08-05 17:55:18 +03:30
committed by GitHub
parent 55dc4c891f
commit 3f8b85906f

View File

@@ -0,0 +1,40 @@
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
- name: Build
run: dotnet build --configuration Release
- name: Publish
run: dotnet publish --configuration Release --output ./publish --no-build
- name: Deploy to IIS via Web Deploy
run: |
msdeploy -verb:sync -source:contentPath="publish" -dest:contentPath="dadmehrg",computerName="https://171.22.24.15:8172/msdeploy.axd?site=dadmehrg",userName=".\deployuser",password="R2rNpdnetP3j>q5b18",authType="Basic" -allowUntrusted
env:
SERVER_HOST: your-server-ip-or-domain
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_PASSWORD: ${{ secrets.DEPLOY_PASSWORD }}