diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0de289f..62d87ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,7 @@ jobs: build-Docker: runs-on: ubuntu-latest + needs: build # for ignoring bad builds steps: - uses: actions/checkout@v2 diff --git a/Dockerfile.CLI b/Dockerfile.CLI index c84e036..4dcc9ad 100644 --- a/Dockerfile.CLI +++ b/Dockerfile.CLI @@ -11,10 +11,6 @@ RUN dotnet restore ./Selector.CLI/Selector.CLI.csproj COPY . ./ -FROM base as test -RUN dotnet restore ./Selector.Tests/Selector.Tests.csproj -RUN dotnet test --no-restore --verbosity normal - FROM base as publish RUN dotnet publish Selector.CLI/Selector.CLI.csproj -c Release -o /app --no-restore diff --git a/Dockerfile.Web b/Dockerfile.Web index 44975ff..d5ef40e 100644 --- a/Dockerfile.Web +++ b/Dockerfile.Web @@ -1,3 +1,11 @@ +FROM node as frontend +COPY ./Selector.Web/package.json /Selector.Web/ +COPY ./Selector.Web/package-lock.json /Selector.Web/ +WORKDIR /Selector.Web +RUN npm ci +COPY ./Selector.Web ./ +RUN npm run build + FROM mcr.microsoft.com/dotnet/sdk:6.0 AS base COPY *.sln . @@ -11,25 +19,14 @@ RUN dotnet restore ./Selector.Web/Selector.Web.csproj COPY . ./ -# FROM base as test -# RUN dotnet restore ./Selector.Tests/Selector.Tests.csproj -# RUN dotnet test --no-restore - FROM base as publish +COPY --from=frontend /Selector.Web/wwwroot Selector.Web/wwwroot/ +COPY --from=frontend /Selector.Web/wwwroot Selector.Web/wwwroot/ RUN dotnet publish Selector.Web/Selector.Web.csproj -c Release -o /app --no-restore -FROM node as frontend -COPY ./Selector.Web/package.json /Selector.Web/ -COPY ./Selector.Web/package-lock.json /Selector.Web/ -WORKDIR /Selector.Web -RUN npm ci -COPY ./Selector.Web/ . -RUN npm run build - FROM mcr.microsoft.com/dotnet/aspnet:6.0 EXPOSE 80 WORKDIR /app COPY --from=publish /app ./ -COPY --from=frontend /Selector.Web/wwwroot ./Selector.Web/wwwroot/ ENV DOTNET_EnableDiagnostics=0 ENTRYPOINT ["dotnet", "Selector.Web.dll"]