File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Build, Test, and Deploy .NET API to Azure Web App
22
3- permissions :
4- contents : read
5-
63on :
74 push :
85 branches : [ "main" ]
1411 - ' backend/**'
1512 workflow_dispatch :
1613
14+ permissions :
15+ contents : read
16+
1717jobs :
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 :
6970 slot-name : ' Production'
7071 package : .
7172 publish-profile : ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_F464F7CADF8B4F09B917F1AB8E78ACE0 }}
72-
You can’t perform that action at this time.
0 commit comments