Skip to content

Commit

Permalink
Refactor Dockerfile: Remove unnecessary steps for deploying to Azure …
Browse files Browse the repository at this point in the history
…Container Registry
  • Loading branch information
crlsocro committed Sep 18, 2024
1 parent 45890ba commit ce23cfb
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/azure-deploy-image-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -44,25 +51,25 @@ 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
uses: actions/setup-dotnet@v4
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:
Expand Down

0 comments on commit ce23cfb

Please sign in to comment.