Skip to content

Commit 7009ff4

Browse files
committed
[ci] separate step to push to registry or save localy - platform and worker
1 parent ec2d27c commit 7009ff4

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

.github/workflows/ci-docker-build.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,28 @@ jobs:
8080
images: ${{ inputs.registry }}/platform
8181
tags: type=raw,value=${{ inputs.image_tag }}${{ inputs.is_fips == 'true' && '-fips' || '' }}
8282

83-
- name: Build and ${{ inputs.is_publish_to_registry == 'true' && 'push' || ' export as tar' }}${{ inputs.is_fips == 'true' && ' FIPS' || '' }}
83+
- name: Build and push ${{ inputs.is_fips == 'true' && 'FIPS' || '' }}
8484
uses: docker/build-push-action@v6
85+
if: inputs.is_publish_to_registry == 'true'
8586
with:
8687
context: opencti-platform
8788
file: opencti-platform/Dockerfile_featurebranch
8889
target: ${{ inputs.dockerfile_target }}
89-
build-args: |
90-
"BASE_TYPE=${{ inputs.is_fips == 'true' && 'fips' || 'alpine' }}"
91-
push: ${{ inputs.is_publish_to_registry == 'true' }}
92-
outputs: ${{ inputs.is_publish_to_registry == 'false' && 'type=docker,dest=/tmp/opencti-platform.tar' }}
90+
build-args: "BASE_TYPE=${{ inputs.is_fips == 'true' && 'fips' || 'alpine' }}"
91+
push: true
92+
tags: ${{ steps.meta.outputs.tags }}
93+
labels: ${{ steps.meta.outputs.labels }}
94+
95+
- name: Build and export as tar ${{ inputs.is_fips == 'true' && ' FIPS' || '' }}
96+
uses: docker/build-push-action@v6
97+
if: inputs.is_publish_to_registry == 'false'
98+
with:
99+
context: opencti-platform
100+
file: opencti-platform/Dockerfile_featurebranch
101+
target: ${{ inputs.dockerfile_target }}
102+
build-args: "BASE_TYPE=${{ inputs.is_fips == 'true' && 'fips' || 'alpine' }}"
103+
push: false
104+
outputs: 'type=docker,dest=/tmp/opencti-platform.tar'
93105
tags: ${{ steps.meta.outputs.tags }}
94106
labels: ${{ steps.meta.outputs.labels }}
95107

@@ -142,8 +154,7 @@ jobs:
142154
with:
143155
context: opencti-worker
144156
file: opencti-worker/Dockerfile
145-
build-args: |
146-
"BASE_TYPE=${{ inputs.is_fips == 'true' && 'fips' || 'alpine' }}"
157+
build-args: "BASE_TYPE=${{ inputs.is_fips == 'true' && 'fips' || 'alpine' }}"
147158
push: true
148159
tags: ${{ steps.meta.outputs.tags }}
149160
labels: ${{ steps.meta.outputs.labels }}
@@ -155,14 +166,14 @@ jobs:
155166
with:
156167
context: opencti-worker
157168
file: opencti-worker/Dockerfile
158-
build-args: |
159-
"BASE_TYPE=${{ inputs.is_fips == 'true' && 'fips' || 'alpine' }}"
169+
build-args: "BASE_TYPE=${{ inputs.is_fips == 'true' && 'fips' || 'alpine' }}"
160170
push: false
161171
outputs: 'type=docker,dest=/tmp/opencti-worker.tar'
162172
tags: ${{ steps.meta.outputs.tags }}
163173
labels: ${{ steps.meta.outputs.labels }}
164174

165-
- name: Upload artifact
175+
- name: Upload worker docker image artifact
176+
if: inputs.is_publish_to_registry == 'false'
166177
uses: actions/upload-artifact@v4
167178
with:
168179
name: docker-image-opencti-worker

0 commit comments

Comments
 (0)