Hi,
I am deploying a tiered blazor server app in iis on a virtual machine hosted in azure using github actions and a pipeline to execute the webdeploy when a push was done, but i am having trouble with an specific project (maui project) that misses the android sdk to finish the build and followingly the webdeploy.
I'll share my workflow first:
name: Deploy Entire App using Web Deploy
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '9.0'
- name: Install MAUI Workloads
run: dotnet workload restore
- name: Restore dependencies
run: dotnet restore
- name: Build project
run: dotnet build --configuration Release
# Publicar e Deploy do AuthServer
- name: Publish AuthServer
run: dotnet publish ./src/Alfa5.AuthServer/Alfa5.AuthServer.csproj -c Release -o ./publish/AuthServer
- name: Deploy using Web Deploy
run: |
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" `
-verb:sync `
-source:contentPath="./publish/AuthServer" `
-dest:iisApp="webdepauthserveralfa5",wmsvc=***,username=***,password=***,authType=Basic `
-allowUntrusted
# Publicar e Deploy do Blazor
- name: Publish Blazor
run: dotnet publish ./src/Alfa5.Blazor/Alfa5.Blazor.csproj -c Release -o ./publish/Blazor
- name: Deploy using Web Deploy
run: |
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" `
-verb:sync `
-source:contentPath="./publish/Blazor" `
-dest:iisApp="webdepblazoralfa5",wmsvc=***,username=***,password=***,authType=Basic `
-allowUntrusted
# Publicar e Deploy do HttpApiHost
- name: Publish Blazor
run: dotnet publish ./src/Alfa5.HttpApi.Host/Alfa5.HttpApi.Host.csproj -c Release -o ./publish/HttpApi.Host
- name: Deploy using Web Deploy
run: |
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" `
-verb:sync `
-source:contentPath="./publish/HttpApi.Host" `
-dest:iisApp="webdephttpapihostalfa5",wmsvc=***,username=***,password=***,authType=Basic `
-allowUntrusted
Iam confused cause I did the webdeploy manually and dont needed to manage these android dependencies, cause I dont even need them, my plans don't involve mobile apps for now. But I wonder if that are solutions for this instead of simply removing that project, because in long terms I will need to solve this.
I already tried to install the sdk from android studio on the virtual machine. Already tried to add the chocolatey command to install the sdk on the workflows. None of them worked.
- ABP Framework version: v0.9.15
- UI Type: Blazor Server
- Database System: EF Core (SQL Server)
- Tiered (for MVC) or Auth Server Separated (for Angular): yes
- Exception message and full stack trace:
Run dotnet build --configuration Release
Determining projects to restore...
Error: C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.24\tools\Xamarin.Android.Tooling.targets(62,5): error XA5300: The Android SDK directory could not be found. Install the Android SDK by following the instructions at: https://aka.ms/dotnet-android-install-sdk [C:\Users\opsadmin\actions-runner-2\_work\alfa5webdeploytest\alfa5webdeploytest\src\Alfa5.Maui\Alfa5.Maui.csproj::TargetFramework=net9.0-android]
Error: C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.24\tools\Xamarin.Android.Tooling.targets(62,5): error XA5300: To use a custom SDK path for a command line build, set the 'AndroidSdkDirectory' MSBuild property to the custom path. [C:\Users\opsadmin\actions-runner-2\_work\alfa5webdeploytest\alfa5webdeploytest\src\Alfa5.Maui\Alfa5.Maui.csproj::TargetFramework=net9.0-android]
- Steps to reproduce the issue: Configure the webdeploy, IIS and the website correctly; Configure the workflow; Make a change, and do a push on the project;
I would like to know if I am doing this correctly, because i am trying to deploy it this way its been a while, there are some documentation of webdeploying tiered apps using github actions?
Thanks :)
2 Answer(s)
-
0
hi
If you don't need to deploy maui project in GitHub Action you can remove it from
solution(.sln).
dotnet sln <SolutionFile> remove <ProjectFile>
see https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-sln#remove
-
0
Hi,
Appreciate your answer, helped a lot.
Now i am facing another problem, my workflow doesn't work as I expected in the deploy step, the runner accuse an error that the site was not found, but I checked a lot of times and the name was correct, I already added it in the iis manager and in the hosts file but didn't work.
I already checked iis, web management service and the firewall, all of them are ok.
my actual workflow is:
name: Deploy Entire App using Web Deploy
on: push: branches: - main
jobs: build-and-deploy: runs-on: windows-latest
steps: - name: Checkout code uses: actions/checkout@v3 - name: Setup .NET uses: actions/setup-dotnet@v3 with: dotnet-version: '9.0' - name: Restore dependencies run: dotnet restore - name: Build project run: dotnet build --configuration Release - name: Publish AuthServer run: dotnet publish ./src/Alfa5.AuthServer/Alfa5.AuthServer.csproj -c Release -o ./publish/AuthServer - name: List published files #debug run: dir ./publish/AuthServer - name: Deploy AuthServer using Web Deploy run: | & "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" ` -verb:sync ` -source:contentPath=./publish/AuthServer ` -dest:iisApp=webdepauthserveralfa5,wmsvc=https://52.168.74.165:8172/msdeploy.axd ,username=***,password=***,authType=Basic ` -allowUntrusted - name: Publish Blazor run: dotnet publish ./src/Alfa5.Blazor/Alfa5.Blazor.csproj -c Release -o ./publish/Blazor - name: Deploy Blazor using Web Deploy run: | & "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" ` -verb:sync ` -source:contentPath=./publish/Blazor ` -dest:iisApp=webdepblazoralfa5,wmsvc=https://52.168.74.165:8172/msdeploy.axd,username=***,password=***,authType=Basic ` -allowUntrusted - name: Publish HttpApiHost run: dotnet publish ./src/Alfa5.HttpApi.Host/Alfa5.HttpApi.Host.csproj -c Release -o ./publish/HttpApi.Host - name: Deploy HttpApiHost using Web Deploy run: | & "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" ` -verb:sync ` -source:contentPath=./publish/HttpApi.Host ` -dest:iisApp=webdephttpapihostalfa5,wmsvc=https://52.168.74.165:8172/msdeploy.axd,username=***,password=***,authType=Basic ` -allowUntrusted
The error message is:
Run & "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe"
& "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe"
-verb:sync-source:contentPath=./publish/AuthServer
-dest:iisApp=webdepauthserveralfa5,wmsvc=https://52.168.74.165:8172/msdeploy.axd,username=sdtweb01\opsadmin,*** ` -allowUntrusted shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'" env: DOTNET_ROOT: C:\Program Files\dotnetError Code: ERROR_SITE_DOES_NOT_EXIST More Information: Site '.' does not exist. Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_SITE_DOES_NOT_EXIST. Error: Object of type 'contentPath' and path './publish/AuthServer' cannot be created. Error count: 1. Error: Process completed with exit code 1.
The steps are the same as the first question that I made, thanks :)