-
Notifications
You must be signed in to change notification settings - Fork 6
72 lines (56 loc) · 2.4 KB
/
dotnet2.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Test and Deploy (Functions Core Tooling)
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: Authenticate to Azure as a Service Principal
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDS_FUNCTION_APP }}
- name: Get the latest source code commit
uses: actions/checkout@v2
- name: List project files before build.settings.json rename
run: tree
working-directory: ${{ env.AZURE_FUNCTION_PROJ_PATH }}
- name: Rename build.settings.json to local.settings.json
run: mv build.settings.json local.settings.json
working-directory: ${{ env.AZURE_FUNCTION_PROJ_PATH }}
- name: List project files after build.settings.json rename
run: tree
working-directory: ${{ env.AZURE_FUNCTION_PROJ_PATH }}
- 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: Clean debug configuration output
run: dotnet clean
working-directory: ${{ env.ROOT_SOLUTION_PATH }}
- name: Build Function App for Release
run: dotnet build ${{ env.AZURE_FUNCTION_PROJ_PATH }} --configuration Release
- name: Install Azure Functions Core Tools
run: npm i -g azure-functions-core-tools@3 --unsafe-perm true
- name: Publish Azure Function App
run: func azure functionapp publish ${{ env.AZURE_FUNCTIONAPP_NAME }}
working-directory: ${{ env.AZURE_FUNCTION_PROJ_PATH }}