-
Notifications
You must be signed in to change notification settings - Fork 22
38 lines (32 loc) · 1.13 KB
/
azure-api.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
name: API Build and Deploy
on:
push:
branches:
- master
paths:
- src/API/**
env:
AZURE_WEBAPP_NAME: elf-ediwang
AZURE_WEBAPP_PACKAGE_PATH: '.'
DOTNET_VERSION: '8.0.x'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@master
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: dotnet build and publish
working-directory: ./src/API
run: |
dotnet build --configuration Release
dotnet publish -c Release --no-build -o '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/elfapi'
- name: 'Run Azure webapp deploy action using publish profile credentials'
uses: azure/webapps-deploy@v3
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }} # Replace with your app name
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} # Define secret variable in repository settings as per action documentation
package: '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/src/API/elfapi'