-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (39 loc) · 1.33 KB
/
WebApiToAzure.yml
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
name: WebAPI CI/CD to Azure
env:
AZURE_WEBAPP_NAME: kpi5
AZURE_WEBAPP_PACKAGE_PATH: './publish'
DOTNET_VERSION: 7.0
PROJECT_PATH: 'src/WebApi'
on:
push:
branches: [ "main" ]
paths: 'src/WebApi/**'
permissions:
contents: read
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore
run: dotnet restore
working-directory: ${{ env.PROJECT_PATH }}
- name: Build
run: dotnet build
working-directory: ${{ env.PROJECT_PATH }}
- name: Publish
run: dotnet publish -c Release -o ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
working-directory: ${{ env.PROJECT_PATH }}
- name: Publish
run: dotnet publish --configuration Release --output ${{ github.workspace }}/${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/kpi5 API/API.csproj
working-directory: ${{ env.PROJECT_PATH }}
- name: Deployment
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE }}
package: ${{ github.workspace }}/${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/kpi5