From faa0a051d43bac1b4481f569d028795f80ff77b4 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 27 Aug 2025 15:57:55 +0200 Subject: [PATCH] Set `DOCKER_NO_PUBLISH` env variable to conditionally skip container publishing. We do not want to publish from our `ci > build` step. `prerelease > build` already does this. --- .github/workflows/ci.yml | 2 ++ build/Targets.fs | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e622aa21d..ad528d107 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,6 +99,8 @@ jobs: - name: Publish Containers if: ${{ matrix.os == 'ubuntu-latest' }} + env: + DOCKER_NO_PUBLISH: true run: dotnet run --project build -c release -- publishcontainers - name: Run Container diff --git a/build/Targets.fs b/build/Targets.fs index b82b6c7fe..547b21dad 100644 --- a/build/Targets.fs +++ b/build/Targets.fs @@ -104,13 +104,14 @@ let private publishContainers _ = "-p"; $"ContainerImageTags=\"%s{labels};%s{Software.Version.Normalize()}\"" "-p"; $"ContainerRepository=elastic/%s{project}" ] + let noPublish = Environment.environVarOrNone "DOCKER_NO_PUBLISH" let registry = - match (ci, pr) with - | Some _, None -> [ + match (ci, pr, noPublish) with + | Some _, None, None -> [ "-p"; "ContainerRegistry=ghcr.io" "-p"; "ContainerUser=1001:1001"; ] - | _, _ -> [] + | _ -> [] exec { run "dotnet" (args @ registry) } createImage "docs-builder" createImage "docs-assembler"