-
Notifications
You must be signed in to change notification settings - Fork 15
58 lines (50 loc) · 1.63 KB
/
dotnet.yml
File metadata and controls
58 lines (50 loc) · 1.63 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
53
54
55
56
57
58
name: Build and Deploy to Azure
on:
workflow_dispatch:
push:
branches: [ "dev" ]
env:
AZURE_APP_NAME: 'headstartdemo-middleware ' # change this to your web app name
AZURE_SLOT_NAME: 'checkout-integrations' # change this to your slot name
DOTNET_VERSION: '6.0.x'
API_PROJECT_PATH: './Customer.OrderCloud.Api/Customer.OrderCloud.Api.csproj'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{env.DOTNET_VERSION}}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Publish
run: dotnet publish ${{env.API_PROJECT_PATH}} -c Release -o website
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2.2.2
with:
name: website
path: ./website/**
if-no-files-found: error
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download a Build Artifact
uses: actions/download-artifact@v2.0.8
with:
name: website
path: website
- name: Deploy web app
id: deploywebapp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_APP_NAME }}
slot-name: ${{ env.AZURE_SLOT_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} # Define secret variable in repository settings
package: website