1717# For more information on the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
1818# For more samples to get started with GitHub Action workflows to deploy to Azure: https://github.com/Azure/actions-workflow-samples
1919
20- name : Build and deploy ASP.Net Core app to an Azure Web App
20+ name : Build and deploy .NET 7 app to an Azure Web App (Linux)
2121
2222env :
23- AZURE_WEBAPP_NAME : your-app-name # set this to the name of your Azure Web App
24- AZURE_WEBAPP_PACKAGE_PATH : ' .' # set this to the path to your web app project, defaults to the repository root
25- DOTNET_VERSION : ' 5' # set this to the .NET Core version to use
23+ AZURE_WEBAPP_NAME : epprofilerlinuxnet7 # set this to the name of your Azure Web App
24+ AZURE_WEBAPP_PACKAGE_PATH : ' .' # set this to the path to your web app project, defaults to the repository root
25+ DOTNET_VERSION : ' 7.x' # set this to the .NET Core version to use
26+ TARGET_PROJECT : ' examples\EnableServiceProfilerNet7'
2627
2728on :
28- push :
29- branches : [ "main" ]
3029 workflow_dispatch :
3130
3231permissions :
3938 steps :
4039 - uses : actions/checkout@v3
4140
42- - name : Set up .NET Core
41+ - name : Set up .NET ${{ env.DOTNET_VERSION }} SDK
4342 uses : actions/setup-dotnet@v2
4443 with :
4544 dotnet-version : ${{ env.DOTNET_VERSION }}
@@ -53,16 +52,18 @@ jobs:
5352 ${{ runner.os }}-nuget-
5453
5554 - name : Build with dotnet
56- run : dotnet build --configuration Release
55+ run : dotnet build ${{ env.TARGET_PROJECT }} --configuration Release
5756
5857 - name : dotnet publish
59- run : dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
58+ run : dotnet publish ${{ env.TARGET_PROJECT }} -c Release -o ${{env.DOTNET_ROOT}}/myapp
6059
6160 - name : Upload artifact for deployment job
6261 uses : actions/upload-artifact@v3
6362 with :
6463 name : .net-app
6564 path : ${{env.DOTNET_ROOT}}/myapp
65+ retention-days : 1
66+
6667
6768 deploy :
6869 permissions :
8485 uses : azure/webapps-deploy@v2
8586 with :
8687 app-name : ${{ env.AZURE_WEBAPP_NAME }}
87- publish-profile : ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
88+ publish-profile : ${{ secrets.NET7_WEBAPI_LINUX_AZURE_WEBAPP_PUBLISH_PROFILE }}
8889 package : ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
0 commit comments