Skip to content

Commit a5aa841

Browse files
committed
Add or update the Azure App Service build and deployment workflow config
1 parent 3357728 commit a5aa841

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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 - AdventuresInSemanticKernel
5+
6+
on:
7+
push:
8+
branches:
9+
- master
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: 'v9.0'
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+
42+
43+
steps:
44+
- name: Download artifact from build job
45+
uses: actions/download-artifact@v4
46+
with:
47+
name: .net-app
48+
49+
- name: Deploy to Azure Web App
50+
id: deploy-to-webapp
51+
uses: azure/webapps-deploy@v3
52+
with:
53+
app-name: 'AdventuresInSemanticKernel'
54+
slot-name: 'Production'
55+
package: .
56+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_58FC0F22AC1E4C94B9CFA8898B1CAC0A }}

0 commit comments

Comments
 (0)