-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCI-CD-FA.yml
64 lines (56 loc) · 2.14 KB
/
CI-CD-FA.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
name: CD
run-name: Deploy Any Environment
# Controls when the workflow will run
on:
workflow_call:
inputs:
runner_name:
type: string
required: true
azure_publish_profile:
type: string
required: true
function_name:
type: string
required: true
function_package_path:
type: string
required: true
workflow_dispatch:
# Environment variables available to all jobs and steps in this workflow
env:
FUNCTION_APP_NAME: ${{ inputs.function_name }}
PUBLISH_PROFILE: ${{secrets[inputs.azure_publish_profile]}}
AZURE_FUNCTIONAPP_PACKAGE_PATH: ${{ inputs.function_package_path }} #'./src/Rsi.TenantManagement.EventFunction' # set this to the path to your web app project, defaults to the repository root
DOTNET_VERSION: '6.0.x' # set this to the dotnet version to use
# A workflow run is made up of one or more jobs
jobs:
build-push-deploy:
runs-on: ${{ inputs.runner_name }}
environment: ${{ inputs.environment_name }}
steps:
- name: Clean up working directory
uses: AutoModality/action-clean@v1
- 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: 'Add nuget source'
run: dotnet nuget add source --username USERNAME --password ${{ secrets.NUGET_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/revenue-solutions-inc/index.json"
continue-on-error: true
- name: 'Resolve Project Dependencies Using Dotnet'
shell: pwsh
run: |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
dotnet build --configuration Release --output ./output
popd
- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
app-name: '${{ env.FUNCTION_APP_NAME }}'
slot-name: 'Production'
package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output'
publish-profile: ${{ env.PUBLISH_PROFILE }}