Skip to content

Commit

Permalink
fix:azureDeploy
Browse files Browse the repository at this point in the history
  • Loading branch information
moshdev2213 committed Sep 9, 2024
1 parent 9fc1472 commit 2a96afa
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/azure_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,22 @@ jobs:
- uses: actions/checkout@v4

- name: Set up .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
dotnet-version: "8.0.x"

- name: Install dependencies
run: dotnet restore
- name: Restore
run: dotnet restore ./backend.sln

- name: Build
run: dotnet publish -c Release -o app
run: dotnet build ./backend.sln --configuration Release --no-restore

- name: Deploy to Azure Web App
- name: Publish
run: dotnet publish ./backend.sln --configuration Release --no-build --output './publish''

- name: Deploy to Azure
uses: azure/webapps-deploy@v2
with:
app-name: apekade-server
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: .
package: "./publish"
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use the official .NET SDK image to build the app
FROM mcr.microsoft.com/dotnet/sdk:8.0
WORKDIR /app

# Copy csproj and restore any dependencies (via NuGet)
COPY *.csproj ./
RUN dotnet restore

# Copy the entire project and build the app
COPY . ./
RUN dotnet publish -c Release -o out

# Use the official .NET runtime image to run the app
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=build /app/out .

# Expose port 80 and define the entry point
EXPOSE 80
ENTRYPOINT ["dotnet", "YourApp.dll"]
25 changes: 25 additions & 0 deletions backend.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "apekade", "apekade.csproj", "{1394DB12-ACB1-4FAB-BA79-1F55F3E98EA9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1394DB12-ACB1-4FAB-BA79-1F55F3E98EA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1394DB12-ACB1-4FAB-BA79-1F55F3E98EA9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1394DB12-ACB1-4FAB-BA79-1F55F3E98EA9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1394DB12-ACB1-4FAB-BA79-1F55F3E98EA9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {193274AC-9C67-4DB0-AA22-B6619000A3FD}
EndGlobalSection
EndGlobal

0 comments on commit 2a96afa

Please sign in to comment.