-
Notifications
You must be signed in to change notification settings - Fork 6
53 lines (43 loc) · 1.61 KB
/
dotnet.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
51
52
53
name: Test and Deploy (Functions Action)
on:
push:
branches: [ main ]
paths-ignore:
- '**/README.md'
- '**/*.yml'
pull_request:
branches: [ main ]
workflow_dispatch:
env:
AZURE_FUNCTIONAPP_NAME: dotnet5-test-app # set this to the name of your azure function app resource
AZURE_FUNCTION_PROJ_PATH: src/Sample.FunctionApp # set this to the path to your function app project
ROOT_SOLUTION_PATH: src # set this to the root path of your solution/project file
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get the latest source code commit
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore dependencies
run: dotnet restore
working-directory: ${{ env.ROOT_SOLUTION_PATH }}
- name: Build for Testing
run: dotnet build --no-restore
working-directory: ${{ env.ROOT_SOLUTION_PATH }}
- name: Test
run: dotnet test --no-build --verbosity normal
working-directory: ${{ env.ROOT_SOLUTION_PATH }}
- name: Build Function App for Release
run: dotnet build --configuration Release --output ./output
working-directory: ${{ env.AZURE_FUNCTION_PROJ_PATH }}
- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
package: '${{ env.AZURE_FUNCTION_PROJ_PATH }}/output'
publish-profile: ${{ secrets.AZURE_FUNCTION_PUBLISH_CREDS }}