Skip to content

Commit bf24f11

Browse files
authored
Update azure-api-cicd.yml
1 parent 9c5dcec commit bf24f11

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

.github/workflows/azure-api-cicd.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
name: Build, Test, and Deploy .NET API to Azure Web App
22

3-
permissions:
4-
contents: read
5-
63
on:
74
push:
85
branches: [ "main" ]
@@ -14,14 +11,17 @@ on:
1411
- 'backend/**'
1512
workflow_dispatch:
1613

14+
permissions:
15+
contents: read
16+
1717
jobs:
18-
build_and_test:
18+
build-and-test:
1919
runs-on: ubuntu-latest
2020

2121
steps:
2222
- uses: actions/checkout@v4
2323

24-
- name: Setup .NET
24+
- name: Setup .NET 6
2525
uses: actions/setup-dotnet@v4
2626
with:
2727
dotnet-version: '6.0.x'
@@ -36,10 +36,10 @@ jobs:
3636

3737
- name: Test
3838
working-directory: ./backend
39-
run: dotnet test AirportAutomation.sln --no-build --verbosity normal
39+
run: dotnet test AirportAutomation.sln --configuration Release --no-build --verbosity normal
4040

4141
- name: dotnet publish (Targeting Web API)
42-
run: dotnet publish ./backend/AirportAutomationApi/AirportAutomationApi.csproj -c Release -o "${{env.DOTNET_ROOT}}/myapp"
42+
run: dotnet publish ./backend/AirportAutomationApi/AirportAutomationApi.csproj -c Release -o "${{env.DOTNET_ROOT}}/myapp"
4343

4444
- name: Upload artifact for deployment job
4545
uses: actions/upload-artifact@v4
@@ -48,11 +48,12 @@ jobs:
4848
path: ${{env.DOTNET_ROOT}}/myapp
4949

5050
deploy:
51-
runs-on: windows-latest
52-
needs: build_and_test
51+
runs-on: ubuntu-latest
52+
needs: build-and-test
5353
permissions:
5454
id-token: write
55-
contents: read
55+
contents: read
56+
5657
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
5758

5859
steps:
@@ -69,4 +70,3 @@ jobs:
6970
slot-name: 'Production'
7071
package: .
7172
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_F464F7CADF8B4F09B917F1AB8E78ACE0 }}
72-

0 commit comments

Comments
 (0)