From 098233fd1b2c8debe02f49cca81cd2da861b9716 Mon Sep 17 00:00:00 2001 From: Mahan Chamani <109232147+mahanch@users.noreply.github.com> Date: Mon, 29 Dec 2025 12:42:26 +0330 Subject: [PATCH] Refactor deployment script to use environment variables --- .github/workflows/dotnet-developPublish.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet-developPublish.yml b/.github/workflows/dotnet-developPublish.yml index 4b5a1e48..79c2e5bd 100644 --- a/.github/workflows/dotnet-developPublish.yml +++ b/.github/workflows/dotnet-developPublish.yml @@ -33,14 +33,18 @@ jobs: shell: powershell run: | $publishFolder = Resolve-Path ./publish + $server = $env:SERVER_HOST + $user = $env:DEPLOY_USER + $pass = $env:DEPLOY_PASSWORD + & "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" ` -verb:sync ` -source:contentPath="$publishFolder" ` - -dest:contentPath="dadmehrg",computerName="https://$env:SERVER_HOST:8172/msdeploy.axd?site=gozareshgir",userName="$env:DEPLOY_USER",password="$env:DEPLOY_PASSWORD",authType="Basic" ` + -dest:contentPath="dadmehrg",computerName="https://${server}:8172/msdeploy.axd?site=gozareshgir",userName="$user",password="$pass",authType="Basic" ` -allowUntrusted ` -enableRule:AppOffline - env: + env: SERVER_HOST: 171.22.24.15 DEPLOY_USER: ${{ secrets.DEPLOY_USER }} DEPLOY_PASSWORD: ${{ secrets.DEPLOY_PASSWORD }}