Skip to content

Commit

Permalink
fix #2
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammed-saalim committed May 19, 2024
1 parent b629fc0 commit 18ede9b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI/CD Pipeline
name: main

on:
push:
Expand All @@ -25,13 +25,13 @@ jobs:
- name: Build and publish .NET app
run: |
dotnet restore ./jobs/jobs.sln
dotnet publish ./jobs/jobs.sln -c Release -o ./out
dotnet publish ./jobs/jobs.csproj -c Release -o ./out
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2 # Updated to v2

- name: Log in to ACR
uses: azure/docker-login@v1 # Updated to v1
uses: azure/docker-login@v1 # Updated to v2
with:
login-server: ${{ secrets.ACR_LOGIN_SERVER }}
username: ${{ secrets.ACR_USERNAME }}
Expand All @@ -50,4 +50,4 @@ jobs:
- name: Deploy to Azure Web App
run: |
az webapp config container set --name ${{ secrets.AZURE_WEBAPP_NAME }} --resource-group ${{ secrets.AZURE_RESOURCE_GROUP }} --docker-custom-image-name ${{ secrets.ACR_LOGIN_SERVER }}/localhandsv1:${{ github.sha }}
az webapp restart --name ${{ secrets.AZURE_WEBAPP_NAME }} --resource-group ${{ secrets.AZURE_RESOURCE_GROUP }}
az webapp restart --name ${{ secrets.AZURE_WEBAPP_NAME }} --resource-group ${{ secrets.AZURE_RESOURCE_GROUP }}
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /App

# Copy the solution file and restore dependencies
# Copy the solution file and the project file
COPY jobs/jobs.sln ./
COPY jobs/jobs.csproj jobs/
RUN dotnet restore
COPY jobs/jobs.csproj ./jobs/

# Restore dependencies
RUN dotnet restore jobs/jobs.sln

# Copy the rest of the application and build
COPY jobs/ jobs/
RUN dotnet publish -c Release -o out
COPY jobs/ ./jobs/
RUN dotnet publish jobs/jobs.csproj -c Release -o out

# Use the ASP.NET runtime image
FROM mcr.microsoft.com/dotnet/aspnet:8.0
Expand Down

0 comments on commit 18ede9b

Please sign in to comment.