Skip to content

Commit 6ece865

Browse files
authored
Update azureprojectgenerator.yml
1 parent 278aa05 commit 6ece865

File tree

1 file changed

+26
-28
lines changed

1 file changed

+26
-28
lines changed

.github/workflows/azureprojectgenerator.yml

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,38 @@ env:
77
AZURE_FUNCTIONAPP_NAME: azureprojectgenerator
88
AZURE_FUNCTIONAPP_PACKAGE_PATH: azure-project-generator/published
99
DOTNET_VERSION: 8.0.x
10-
WORKING_DIRECTORY: azure-project-generator
1110

1211
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
1515
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
1820
uses: actions/setup-dotnet@v3
1921
with:
2022
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'
4239
uses: Azure/functions-action@v1
40+
id: fa
4341
with:
4442
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

Comments
 (0)