1+ # Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
2+ # More GitHub Actions for Azure: https://github.com/Azure/actions
3+
4+ name : Build and deploy ASP.Net Core app to Azure Web App - sample-trigger
5+
6+ on :
7+ push :
8+ branches :
9+ - feature/update-samples-and-documentation
10+ workflow_dispatch :
11+
12+ jobs :
13+ build :
14+ runs-on : ubuntu-latest
15+
16+ steps :
17+ - uses : actions/checkout@v4
18+
19+ - name : Set up .NET Core
20+ uses : actions/setup-dotnet@v1
21+ with :
22+ dotnet-version : ' 8.x'
23+ include-prerelease : true
24+
25+ - name : Build with dotnet
26+ run : dotnet build --configuration Release
27+
28+ - name : dotnet publish
29+ run : dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
30+
31+ - name : Upload artifact for deployment job
32+ uses : actions/upload-artifact@v3
33+ with :
34+ name : .net-app
35+ path : ${{env.DOTNET_ROOT}}/myapp
36+
37+ deploy :
38+ runs-on : ubuntu-latest
39+ needs : build
40+ environment :
41+ name : ' Production'
42+ url : ${{ steps.deploy-to-webapp.outputs.webapp-url }}
43+ permissions :
44+ id-token : write # This is required for requesting the JWT
45+
46+ steps :
47+ - name : Download artifact from build job
48+ uses : actions/download-artifact@v3
49+ with :
50+ name : .net-app
51+
52+ - name : Login to Azure
53+ uses : azure/login@v1
54+ with :
55+ client-id : ${{ secrets.AZUREAPPSERVICE_CLIENTID_410FEBA142964ADC8BDDD567E0E6CF22 }}
56+ tenant-id : ${{ secrets.AZUREAPPSERVICE_TENANTID_F98AA0B0793242C187FA3A99A82D66A1 }}
57+ subscription-id : ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_9495FAD158814482BE8A7C1AF843FF35 }}
58+
59+ - name : Deploy to Azure Web App
60+ id : deploy-to-webapp
61+ uses : azure/webapps-deploy@v2
62+ with :
63+ app-name : ' sample-trigger'
64+ slot-name : ' Production'
65+ package : .
66+
0 commit comments