|
9 | 9 | AZURE_FUNCTIONAPP_NAME: FitSyncHubFunctionsApp |
10 | 10 | AZURE_FUNCTIONAPP_PACKAGE_PATH: src/FitSyncHub.Functions/published |
11 | 11 | CONFIGURATION: Release |
12 | | - DOTNET_CORE_VERSION: 9.0.x |
| 12 | + DOTNET_VERSION: 9.0.x |
13 | 13 | WORKING_DIRECTORY: src/FitSyncHub.Functions |
14 | 14 | jobs: |
15 | | - build: |
| 15 | + build-and-deploy: |
16 | 16 | runs-on: ubuntu-latest |
17 | 17 | steps: |
18 | | - - uses: actions/checkout@v4 |
| 18 | + - name: 'Checkout GitHub Action' |
| 19 | + uses: actions/checkout@v4 |
19 | 20 |
|
20 | | - - name: Setup .NET SDK |
| 21 | + - name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment |
21 | 22 | uses: actions/setup-dotnet@v4 |
22 | 23 | with: |
23 | | - dotnet-version: ${{ env.DOTNET_CORE_VERSION }} |
| 24 | + dotnet-version: ${{ env.DOTNET_VERSION }} |
24 | 25 |
|
25 | | - - name: Restore |
26 | | - run: dotnet restore "${{ env.WORKING_DIRECTORY }}" |
27 | | - |
28 | | - - name: Build |
29 | | - run: dotnet build "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-restore |
30 | | - |
31 | | - - name: Publish |
32 | | - run: dotnet publish "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-build --output "${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}" |
33 | | - |
34 | | - - name: Publish Artifacts |
35 | | - uses: actions/upload-artifact@v4 |
36 | | - with: |
37 | | - name: functionapp |
38 | | - path: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }} |
39 | | - include-hidden-files: true |
40 | | - retention-days: 30 |
41 | | - deploy: |
42 | | - runs-on: ubuntu-latest |
43 | | - permissions: |
44 | | - id-token: write #This is required for requesting the JWT |
45 | | - needs: build |
46 | | - steps: |
47 | | - |
48 | | - - name: Download artifact from build job |
49 | | - uses: actions/download-artifact@v4 |
50 | | - with: |
51 | | - name: functionapp |
52 | | - path: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }} |
| 26 | + - name: 'Resolve Project Dependencies Using Dotnet' |
| 27 | + shell: bash |
| 28 | + run: | |
| 29 | + pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}' |
| 30 | + dotnet build --configuration Release --output ./output |
| 31 | + popd |
53 | 32 |
|
54 | 33 | - name: Deploy to Azure Function App |
55 | 34 | uses: Azure/functions-action@v1 |
56 | 35 | id: fa |
57 | 36 | with: |
58 | 37 | app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }} |
59 | | - package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }} |
| 38 | + package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output' |
| 39 | + sku: 'flexconsumption' # Parameter required when using a publish profile with Flex Consumption |
60 | 40 | publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }} |
0 commit comments