forked from CloudLabsAI-Azure/Contact-Database-Application
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (42 loc) · 1.27 KB
/
master_contactdatabasezapp.yml
File metadata and controls
52 lines (42 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Build and Deploy MyMvcApp
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
# Step 1: Checkout the code
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Setup .NET Core
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0' # Adjust this to match your .NET version
# Step 3: Restore dependencies
- name: Restore dependencies
run: dotnet restore
# Step 4: Build the application
- name: Build the application
run: dotnet build --configuration Release --no-restore
# Step 5: Publish the application
- name: Publish the application
run: dotnet publish -c Release -o ./publish
deploy:
runs-on: windows-latest
needs: build
steps:
# Step 1: Checkout the code
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Deploy to Azure Web App
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v2
with:
app-name: 'MyMvcApp' # Replace with your Azure Web App name
slot-name: 'production'
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: ./publish