Skip to content

Commit faa0a05

Browse files
committed
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.
1 parent 19594a0 commit faa0a05

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ jobs:
9999

100100
- name: Publish Containers
101101
if: ${{ matrix.os == 'ubuntu-latest' }}
102+
env:
103+
DOCKER_NO_PUBLISH: true
102104
run: dotnet run --project build -c release -- publishcontainers
103105

104106
- name: Run Container

build/Targets.fs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,14 @@ let private publishContainers _ =
104104
"-p"; $"ContainerImageTags=\"%s{labels};%s{Software.Version.Normalize()}\""
105105
"-p"; $"ContainerRepository=elastic/%s{project}"
106106
]
107+
let noPublish = Environment.environVarOrNone "DOCKER_NO_PUBLISH"
107108
let registry =
108-
match (ci, pr) with
109-
| Some _, None -> [
109+
match (ci, pr, noPublish) with
110+
| Some _, None, None -> [
110111
"-p"; "ContainerRegistry=ghcr.io"
111112
"-p"; "ContainerUser=1001:1001";
112113
]
113-
| _, _ -> []
114+
| _ -> []
114115
exec { run "dotnet" (args @ registry) }
115116
createImage "docs-builder"
116117
createImage "docs-assembler"

0 commit comments

Comments
 (0)