-
Notifications
You must be signed in to change notification settings - Fork 3
46 lines (45 loc) · 1.63 KB
/
buildfunctionsapp.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
name: Build and deploy .NET Functions application to App name feedbackbot_AZURE_FUNCTIONS_NAME using profile in secret feedbackbot_PUBLISH_PROFILE_FUNCTIONS
on:
push:
branches:
- main
env:
AZURE_FUNC_PACKAGE_PATH: Functions\publish
CONFIGURATION: Release
DOTNET_CORE_VERSION: 8.0.x
WORKING_DIRECTORY_FUNC: src\Functions
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_CORE_VERSION }}
- name: Restore Functions App
run: dotnet restore "${{ env.WORKING_DIRECTORY_FUNC }}"
- name: Build Functions App
run: dotnet build "${{ env.WORKING_DIRECTORY_FUNC }}" --configuration ${{ env.CONFIGURATION }} --no-restore
- name: Publish Functions App
run: dotnet publish "${{ env.WORKING_DIRECTORY_FUNC }}" --configuration ${{ env.CONFIGURATION }} --no-build --output "${{ env.AZURE_FUNC_PACKAGE_PATH }}"
- name: Publish function
uses: actions/upload-artifact@v3
with:
name: func
path: ${{ env.AZURE_FUNC_PACKAGE_PATH }}
deploy:
runs-on: windows-latest
needs: build
steps:
- name: Download Functions App artifact from build job
uses: actions/download-artifact@v3
with:
name: func
path: ${{ env.AZURE_FUNC_PACKAGE_PATH }}
- name: Deploy Functions App to Azure WebApp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.feedbackbot_AZURE_FUNCTIONS_NAME }}
publish-profile: ${{ secrets.feedbackbot_PUBLISH_PROFILE_FUNCTIONS }}
package: ${{ env.AZURE_FUNC_PACKAGE_PATH }}