From 78a7930750dc513c0dba1203f568d9c651881d5a Mon Sep 17 00:00:00 2001 From: bdovaz Date: Thu, 28 Dec 2023 21:37:44 +0100 Subject: [PATCH] Fix Docker image build --- .dockerignore | 7 ++++++- .github/workflows/docker-image.yml | 4 +++- Dockerfile | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index 821c19db..69cb87bd 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,6 @@ -.github \ No newline at end of file +.github +examples/docker/unity_packages + +**/.vs +**/bin +**/obj diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 9d349841..c3a3cb51 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -4,6 +4,7 @@ on: push: tags: - '*' + pull_request: env: PROJECT_NAME: UnityNuGet @@ -28,6 +29,7 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Log in to the Container registry + if: github.event_name == 'push' uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} @@ -44,7 +46,7 @@ jobs: uses: docker/build-push-action@v5 with: context: . - push: true + push: ${{ github.event_name == 'push' }} platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index a6722338..7538bf22 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,8 @@ WORKDIR /app RUN mkdir -p src/UnityNuGet && mkdir -p src/UnityNuGet.Server && mkdir -p src/UnityNuGet.Tests +COPY src/Directory.Build.props src/Directory.Build.props +COPY src/Directory.Packages.props src/Directory.Packages.props COPY src/*.sln src COPY src/UnityNuGet/*.csproj src/UnityNuGet COPY src/UnityNuGet.Server/*.csproj src/UnityNuGet.Server