Skip to content

Commit 0d888f1

Browse files
committed
Add or update the Azure App Service build and deployment workflow config
1 parent c9e7326 commit 0d888f1

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 - TableBookingAPI
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+
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: 'TableBookingAPI'
54+
slot-name: 'Production'
55+
package: .
56+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_CB24D4FFD71B40AC987EF81778A57D86 }}

0 commit comments

Comments
 (0)