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 - showcaseerik
5+
6+ on :
7+ push :
8+ branches :
9+ - main
10+ workflow_dispatch :
11+
12+ jobs :
13+ build :
14+ runs-on : windows-latest
15+ permissions :
16+ contents : read # This is required for actions/checkout
17+
18+ steps :
19+ - uses : actions/checkout@v4
20+
21+ - name : Set up .NET Core
22+ uses : actions/setup-dotnet@v4
23+ with :
24+ dotnet-version : ' 9.x'
25+
26+ - name : Build with dotnet
27+ run : dotnet build --configuration Release
28+
29+ - name : dotnet publish
30+ run : dotnet publish -c Release -o "${{env.DOTNET_ROOT}}/myapp"
31+
32+ - name : Upload artifact for deployment job
33+ uses : actions/upload-artifact@v4
34+ with :
35+ name : .net-app
36+ path : ${{env.DOTNET_ROOT}}/myapp
37+
38+ deploy :
39+ runs-on : windows-latest
40+ needs : build
41+ permissions :
42+ id-token : write # This is required for requesting the JWT
43+ contents : read # This is required for actions/checkout
44+
45+ steps :
46+ - name : Download artifact from build job
47+ uses : actions/download-artifact@v4
48+ with :
49+ name : .net-app
50+
51+ - name : Login to Azure
52+ uses : azure/login@v2
53+ with :
54+ client-id : ${{ secrets.AZUREAPPSERVICE_CLIENTID_305F1C058E584C66813F67EBF9729DAB }}
55+ tenant-id : ${{ secrets.AZUREAPPSERVICE_TENANTID_2C08E1B79CB34E96BFB71DB9C95312F4 }}
56+ subscription-id : ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_9566A004CD3F45B693CCAA517E0A945A }}
57+
58+ - name : Deploy to Azure Web App
59+ id : deploy-to-webapp
60+ uses : azure/webapps-deploy@v3
61+ with :
62+ app-name : ' showcaseerik'
63+ slot-name : ' Production'
64+ package : .
65+
0 commit comments