-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (50 loc) · 1.86 KB
/
deploy.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
name: Production - Build and Deploy Functions
on:
push:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
AZURE_FUNCTIONAPP_NAME: CandidateManager.Functions # set this to your application's name
TESTAPP_PACKAGE_PATH: './src/CandidateManager.Tests' # set path to test project
AZURE_FUNCTIONAPP_PACKAGE_PATH: './src/CandidateManager.Functions' # set this to the path to your web app project, defaults to the repository root
DOTNET_VERSION: '5.0.x'
CONFIGURATION: Release
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET 3.1 Environment
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
- name: Setup .NET ${{ env.DOTNET_VERSION }} Environment
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: 'Resolve Project Dependencies Using Dotnet'
shell: bash
run: |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
dotnet build --configuration ${{ env.CONFIGURATION }} --output ./output
popd
- name: 'Run unit tests'
shell: bash
run: |
pushd './${{ env.TESTAPP_PACKAGE_PATH }}'
dotnet test --configuration ${{ env.CONFIGURATION }}
popd
# upload report as build artifact
- name: Upload a Build Artifact (Tests)
uses: actions/upload-artifact@v2
with:
name: 'Test Run'
path: ${{github.workspace}}/${{env.TEST_FILE_NAME}}
- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output'
publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}