Skip to content

Commit 00c3b01

Browse files
committed
Add or update the Azure App Service build and deployment workflow config
1 parent 9a792cc commit 00c3b01

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed
+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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 - newapp2003
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
runs-on: windows-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: '6.0.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: windows-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_D15CF4AEC77340199A90AD71583F9F3E }}
56+
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_DBE3977D85DF4C4CB3D16F766440C83E }}
57+
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_0AEC8BD49A044CF8A7180288C21D0FC9 }}
58+
59+
- name: Deploy to Azure Web App
60+
id: deploy-to-webapp
61+
uses: azure/webapps-deploy@v2
62+
with:
63+
app-name: 'newapp2003'
64+
slot-name: 'Production'
65+
package: .
66+

0 commit comments

Comments
 (0)