-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (49 loc) · 1.79 KB
/
main.yml
File metadata and controls
54 lines (49 loc) · 1.79 KB
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
name: Deploy Azure Functions
on:
push:
branches:
- main
- dev
paths-ignore:
- "README.md"
env:
AZURE_FUNCTIONAPP_NAME: arsenalextractor-2209-func # set this to your application's name
DOTNET_VERSION: "7.0.100" # set this to the dotnet version to use
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: "Checkout GitHub action"
uses: actions/checkout@v2
- name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: "Resolve Project Dependencies Using Dotnet"
shell: bash
run: dotnet publish ./src/ArsenalExtractor.Functions/src/ArsenalExtractor.csproj --configuration Release --output ./output
- name: Unit Tests
run: |
dotnet restore ./src/ArsenalExtractor.Functions/tests/unit-tests/unit-tests.csproj
dotnet test ./src/ArsenalExtractor.Functions/tests/unit-tests/unit-tests.csproj --no-restore --verbosity normal
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: build
path: output
deploy:
runs-on: ubuntu-latest
needs: build-and-test
steps:
- name: Download build result for job build
uses: actions/download-artifact@v3
with:
name: build
path: output
- name: "Run Azure Functions action"
uses: Azure/functions-action@v1
with:
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
package: "output"
publish-profile: ${{(github.ref == 'refs/heads/main' && secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE) || secrets.AZURE_FUNCTIONAPP_DEV_PUBLISH_PROFILE }}
slot-name: ${{(github.ref == 'refs/heads/main' && 'production') || 'dev'}}