File tree Expand file tree Collapse file tree 1 file changed +65
-0
lines changed Expand file tree Collapse file tree 1 file changed +65
-0
lines changed Original file line number Diff line number Diff line change
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 - dynamics-charity
5
+
6
+ on :
7
+ push :
8
+ branches :
9
+ - main
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@v4
21
+ with :
22
+ dotnet-version : ' 8.x'
23
+
24
+ - name : Build with dotnet
25
+ run : dotnet build --configuration Release
26
+
27
+ - name : dotnet publish
28
+ run : dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
29
+
30
+ - name : Upload artifact for deployment job
31
+ uses : actions/upload-artifact@v4
32
+ with :
33
+ name : .net-app
34
+ path : ${{env.DOTNET_ROOT}}/myapp
35
+
36
+ deploy :
37
+ runs-on : ubuntu-latest
38
+ needs : build
39
+ environment :
40
+ name : ' Production'
41
+ url : ${{ steps.deploy-to-webapp.outputs.webapp-url }}
42
+ permissions :
43
+ id-token : write # This is required for requesting the JWT
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_AD7AD70C780C405B96475E6FBED7E6D0 }}
55
+ tenant-id : ${{ secrets.AZUREAPPSERVICE_TENANTID_AB56BBFE25D746D7AEDA08DF0FC89769 }}
56
+ subscription-id : ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_19C983654C864AFCA830BB0AEED04616 }}
57
+
58
+ - name : Deploy to Azure Web App
59
+ id : deploy-to-webapp
60
+ uses : azure/webapps-deploy@v3
61
+ with :
62
+ app-name : ' dynamics-charity'
63
+ slot-name : ' Production'
64
+ package : .
65
+
You can’t perform that action at this time.
0 commit comments