diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb25778..a9bd9ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: run: dotnet test --no-build --configuration=Release --verbosity normal - name: Build the Docker image - run: docker build . --file Dockerfile --tag awaescher/maxpower:${{steps.gitversion.outputs.semVer}} --tag awaescher/maxpower:latest --build-arg SEMVERSION=${{steps.gitversion.outputs.semVer}} + run: docker build . --file Dockerfile --tag awaescher/maxpower:${{steps.gitversion.outputs.semVer}} --tag awaescher/maxpower:latest --build-arg SEMVERSION=${{steps.gitversion.outputs.FullSemVer}} --build-arg ASSEMBLYSEMVERSION=${{steps.gitversion.outputs.AssemblySemVer}} - name: Log in to Docker Hub uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a diff --git a/Dockerfile b/Dockerfile index f642955..98ab389 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0.101 AS build WORKDIR / +ARG ASSEMBLYSEMVERSION ARG SEMVERSION # copy csproj and restore as distinct layers @@ -16,7 +17,7 @@ WORKDIR / COPY ./MaxPower /app/MaxPower/ COPY ./MaxTalkSharp /app/MaxTalkSharp/ WORKDIR /app/MaxPower/ -RUN dotnet publish -c Release -r linux-arm64 -o out -p:PublishSingleFile=true --self-contained true /p:AssemblyVersion=$SEMVERSION /p:Version=$SEMVERSION +RUN dotnet publish -c Release -r linux-arm64 -o out -p:PublishSingleFile=true --self-contained true /p:AssemblyVersion=$ASSEMBLYSEMVERSION /p:Version=$SEMVERSION # RUNTIME CONTAINER FROM mcr.microsoft.com/dotnet/aspnet:8.0.2-jammy-arm64v8 AS runtime @@ -24,4 +25,4 @@ EXPOSE 80 WORKDIR /app COPY --from=build /app/MaxPower/out ./ #RUN rm /app/appsettings.Development.json -ENTRYPOINT ["./MaxPower", ""] \ No newline at end of file +ENTRYPOINT ["./MaxPower", ""]