From ce23cfb2dd203c67685dc58f46dbf76f7f117727 Mon Sep 17 00:00:00 2001 From: crlsocro Date: Wed, 18 Sep 2024 15:41:01 +0200 Subject: [PATCH] Refactor Dockerfile: Remove unnecessary steps for deploying to Azure Container Registry --- .github/workflows/azure-deploy-image-test.yml | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/azure-deploy-image-test.yml b/.github/workflows/azure-deploy-image-test.yml index b60cede..0c5dc53 100644 --- a/.github/workflows/azure-deploy-image-test.yml +++ b/.github/workflows/azure-deploy-image-test.yml @@ -36,6 +36,13 @@ jobs: working-directory: ./Bouvet.Developer.Survey.Backend run: dotnet publish Bouvet.Developer.Survey.Backend.generated.sln --configuration Release --no-build + # Save build artifacts to be used in the test job + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: build-artifacts + path: ./Bouvet.Developer.Survey.Backend/bin/Release/net8.0/publish + test: runs-on: ubuntu-latest needs: build @@ -44,7 +51,7 @@ jobs: image: mcr.microsoft.com/dotnet/sdk:8.0 steps: - - name: Checkout code + - name: Checkout project uses: actions/checkout@v4 - name: Set up .NET Core @@ -52,17 +59,17 @@ jobs: with: dotnet-version: ${{ env.DOTNET_VERSION }} - - name: Dotnet restore - working-directory: ./Bouvet.Developer.Survey.Backend - run: dotnet restore Bouvet.Developer.Survey.Backend.generated.sln - - - name: Build with dotnet - working-directory: ./Bouvet.Developer.Survey.Backend - run: dotnet build Bouvet.Developer.Survey.Backend.generated.sln --configuration Release --no-restore + # Download the build artifacts from the build job + - name: Download build artifacts + uses: actions/download-artifact@v3 + with: + name: build-artifacts + path: ./Bouvet.Developer.Survey.Backend/bin/Release/net8.0/publish + # Run tests using the downloaded build artifacts - name: Test with dotnet working-directory: ./Bouvet.Developer.Survey.Backend - run: dotnet test Bouvet.Developer.Survey.Backend.generated.sln --configuration Release --no-build + run: dotnet test Bouvet.Developer.Survey.Backend.generated.sln --no-build deploy-to-azure: