|
7 | 7 | AZURE_FUNCTIONAPP_NAME: azureprojectgenerator
|
8 | 8 | AZURE_FUNCTIONAPP_PACKAGE_PATH: azure-project-generator/published
|
9 | 9 | DOTNET_VERSION: 8.0.x
|
10 |
| - WORKING_DIRECTORY: azure-project-generator |
11 | 10 |
|
12 | 11 | jobs:
|
13 |
| - build: |
14 |
| - runs-on: ubuntu-latest |
| 12 | + build-and-deploy: |
| 13 | + runs-on: ubuntu-latest # For Linux, use ubuntu-latest |
| 14 | + environment: dev |
15 | 15 | steps:
|
16 |
| - - uses: actions/checkout@v4 |
17 |
| - - name: Setup .NET SDK |
| 16 | + - name: 'Checkout GitHub Action' |
| 17 | + uses: actions/checkout@v3 |
| 18 | + |
| 19 | + - name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment |
18 | 20 | uses: actions/setup-dotnet@v3
|
19 | 21 | with:
|
20 | 22 | dotnet-version: ${{ env.DOTNET_VERSION }}
|
21 |
| - - name: Restore |
22 |
| - run: dotnet restore "${{ env.WORKING_DIRECTORY }}" |
23 |
| - - name: Build |
24 |
| - run: dotnet build "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-restore |
25 |
| - - name: Publish |
26 |
| - run: dotnet publish "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-build --output "${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}" |
27 |
| - - name: Publish Artifacts |
28 |
| - uses: actions/upload-artifact@v3 |
29 |
| - with: |
30 |
| - name: functionapp |
31 |
| - path: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }} |
32 |
| - deploy: |
33 |
| - runs-on: ubuntu-latest |
34 |
| - needs: build |
35 |
| - steps: |
36 |
| - - name: Download artifact from build job |
37 |
| - uses: actions/download-artifact@v3 |
38 |
| - with: |
39 |
| - name: functionapp |
40 |
| - path: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }} |
41 |
| - - name: Deploy to Azure Function App |
| 23 | + |
| 24 | + - name: 'Resolve Project Dependencies Using Dotnet' |
| 25 | + shell: pwsh # For Linux, use bash |
| 26 | + run: | |
| 27 | + pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}' |
| 28 | + dotnet build --configuration Release --output ./output |
| 29 | + popd |
| 30 | +
|
| 31 | + - name: 'Run Unit Tests' |
| 32 | + shell: pwsh # For Linux, use bash |
| 33 | + run: | |
| 34 | + pushd './tests' |
| 35 | + dotnet test --verbosity normal |
| 36 | + popd |
| 37 | +
|
| 38 | + - name: 'Run Azure Functions Action' |
42 | 39 | uses: Azure/functions-action@v1
|
| 40 | + id: fa |
43 | 41 | with:
|
44 | 42 | app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
|
45 |
| - publish-profile: ${{ secrets.azureprojectgenerator_A149 }} |
46 |
| - package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }} |
| 43 | + package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output' |
| 44 | + publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }} |
0 commit comments