diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..ca93100e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,22 @@ +name: Auto Build CI + +on: + push: + branches: + - master + - dev-Actions + + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 2.2.108 + - name: Build with dotnet + run: dotnet build src/admin/Bootstrap.Admin/ --configuration Release \ No newline at end of file diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..dd3f45e2 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,17 @@ +name: Docker Image CI + +on: + push: + branches: + - master + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Build the Docker image + run: docker build . --file src/admin/Bootstrap.Admin/Linux.Dockerfile --tag ba:$(date +%s) diff --git a/.gitignore b/.gitignore index c6b305e5..3f99431e 100644 --- a/.gitignore +++ b/.gitignore @@ -347,7 +347,7 @@ ASALocalRun/ **/[tT]humbs.db # Net Core Keys -[Kk]eys/ +**/[Kk]eys/*.xml Bootstrap.Admin.xml ###### -- Custom Ignore Section, Make sure all files you add to the git repo are below this line -- ###### diff --git a/Directory.Build.props b/Directory.Build.props index 278091a6..9df49bac 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -14,8 +14,8 @@ - - + + \ No newline at end of file diff --git a/src/admin/Bootstrap.Admin/Dockerfile b/src/admin/Bootstrap.Admin/Dockerfile index 04979df9..9d5bfa4f 100644 --- a/src/admin/Bootstrap.Admin/Dockerfile +++ b/src/admin/Bootstrap.Admin/Dockerfile @@ -7,19 +7,15 @@ EXPOSE 80 FROM microsoft/dotnet:2.2-sdk-nanoserver-1803 AS build WORKDIR /src -COPY ["Bootstrap.Admin/Bootstrap.Admin.csproj", "Bootstrap.Admin/"] -COPY ["Bootstrap.DataAccess/Bootstrap.DataAccess.csproj", "Bootstrap.DataAccess/"] -RUN dotnet restore "Bootstrap.Admin/Bootstrap.Admin.csproj" -COPY . . -WORKDIR "/src/Bootstrap.Admin" -RUN dotnet build "Bootstrap.Admin.csproj" -c Release -o /app +COPY src/admin . +WORKDIR "/src/Bootstrap.Admin" FROM build AS publish -RUN dotnet publish "Bootstrap.Admin.csproj" -c Release -o /app +RUN dotnet publish -c Release -o /app FROM base AS final WORKDIR /app COPY --from=publish /app . -COPY --from=build ["/src/Bootstrap.Admin/BootstrapAdmin.db", "./BootstrapAdmin.db"] -COPY --from=build ["/src/Scripts/Longbow.lic", "./Longbow.lic"] +COPY --from=publish ["/src/Bootstrap.Admin/BootstrapAdmin.db", "./BootstrapAdmin.db"] +COPY --from=publish ["/src/keys/Longbow.lic", "./Longbow.lic"] ENTRYPOINT ["dotnet", "Bootstrap.Admin.dll"] \ No newline at end of file diff --git a/src/admin/Bootstrap.Admin/Linux.Dockerfile b/src/admin/Bootstrap.Admin/Linux.Dockerfile index 3df692f5..fe4ea758 100644 --- a/src/admin/Bootstrap.Admin/Linux.Dockerfile +++ b/src/admin/Bootstrap.Admin/Linux.Dockerfile @@ -1,22 +1,21 @@ -FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base +#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed. +#For more information, please see https://aka.ms/containercompat + +FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base WORKDIR /app EXPOSE 80 FROM microsoft/dotnet:2.2-sdk AS build WORKDIR /src -COPY ["Bootstrap.Admin/Bootstrap.Admin.csproj", "Bootstrap.Admin/"] -COPY ["Bootstrap.DataAccess/Bootstrap.DataAccess.csproj", "Bootstrap.DataAccess/"] -RUN dotnet restore "Bootstrap.Admin/Bootstrap.Admin.csproj" -COPY . . -WORKDIR "/src/Bootstrap.Admin" -RUN dotnet build "Bootstrap.Admin.csproj" -c Release -o /app +COPY src/admin . +WORKDIR "/src/Bootstrap.Admin" FROM build AS publish -RUN dotnet publish "Bootstrap.Admin.csproj" -c Release -o /app +RUN dotnet publish -c Release -o /app FROM base AS final WORKDIR /app COPY --from=publish /app . COPY --from=publish ["/src/Bootstrap.Admin/BootstrapAdmin.db", "./BootstrapAdmin.db"] -COPY --from=publish ["/src/Scripts/Longbow.lic", "./Longbow.lic"] +COPY --from=publish ["/src/keys/Longbow.lic", "./Longbow.lic"] ENTRYPOINT ["dotnet", "Bootstrap.Admin.dll"] \ No newline at end of file diff --git a/scripts/Longbow.lic b/src/admin/keys/Longbow.lic similarity index 100% rename from scripts/Longbow.lic rename to src/admin/keys/Longbow.lic