-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
100 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Publish container | ||
|
||
on: | ||
# Runs on pushes targeting the default branch | ||
push: | ||
branches: ["main"] | ||
tags: | ||
- "v*.*.*" | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
login: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build the Docker image | ||
run: | | ||
docker build . --tag ghcr.io/ntxinh/AspNetCore-DDD:latest | ||
docker push ghcr.io/ntxinh/AspNetCore-DDD:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# .NET Core SDK | ||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build | ||
|
||
# Sets the working directory | ||
WORKDIR /app | ||
|
||
# Copy Projects | ||
#COPY *.sln . | ||
COPY Src/DDD.Application/DDD.Application.csproj ./Src/DDD.Application/ | ||
COPY Src/DDD.Domain/DDD.Domain.csproj ./Src/DDD.Domain/ | ||
COPY Src/DDD.Domain.Core/DDD.Domain.Core.csproj ./Src/DDD.Domain.Core/ | ||
COPY Src/DDD.Infra.CrossCutting.Bus/DDD.Infra.CrossCutting.Bus.csproj ./Src/DDD.Infra.CrossCutting.Bus/ | ||
COPY Src/DDD.Infra.CrossCutting.Identity/DDD.Infra.CrossCutting.Identity.csproj ./Src/DDD.Infra.CrossCutting.Identity/ | ||
COPY Src/DDD.Infra.CrossCutting.IoC/DDD.Infra.CrossCutting.IoC.csproj ./Src/DDD.Infra.CrossCutting.IoC/ | ||
COPY Src/DDD.Infra.Data/DDD.Infra.Data.csproj ./Src/DDD.Infra.Data/ | ||
COPY Src/DDD.Services.Api/DDD.Services.Api.csproj ./Src/DDD.Services.Api/ | ||
|
||
# .NET Core Restore | ||
RUN dotnet restore ./Src/DDD.Services.Api/DDD.Services.Api.csproj | ||
|
||
# Copy All Files | ||
COPY Src ./Src | ||
|
||
# .NET Core Build and Publish | ||
RUN dotnet publish ./Src/DDD.Services.Api/DDD.Services.Api.csproj -c Release -o /publish | ||
|
||
# ASP.NET Core Runtime | ||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS runtime | ||
WORKDIR /app | ||
COPY --from=build /publish ./ | ||
|
||
# Expose ports | ||
EXPOSE 80 | ||
EXPOSE 443 | ||
|
||
# Setup your variables before running. | ||
ARG MyEnv | ||
ENV ASPNETCORE_ENVIRONMENT $MyEnv | ||
|
||
ENTRYPOINT ["dotnet", "DDD.Services.Api.dll"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters