Skip to content

Commit ec2d27c

Browse files
committed
[ci] separate step to push to registry or save localy
1 parent e72c669 commit ec2d27c

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,29 @@ jobs:
136136
images: ${{ inputs.registry }}/worker
137137
tags: type=raw,value=${{ inputs.image_tag }}${{ inputs.is_fips == 'true' && '-fips' || '' }}
138138

139-
- name: Build and ${{ inputs.is_publish_to_registry == 'true' && 'push' || ' export as tar' }}${{ inputs.is_fips == 'true' && ' FIPS' || '' }}
139+
- name: Build and push ${{ inputs.is_fips == 'true' && 'FIPS' || '' }}
140140
uses: docker/build-push-action@v6
141+
if: inputs.is_publish_to_registry == 'true'
141142
with:
142143
context: opencti-worker
143144
file: opencti-worker/Dockerfile
144145
build-args: |
145146
"BASE_TYPE=${{ inputs.is_fips == 'true' && 'fips' || 'alpine' }}"
146-
push: ${{ inputs.is_publish_to_registry == 'true' }}
147-
outputs: ${{ inputs.is_publish_to_registry == 'false' && 'type=docker,dest=/tmp/opencti-worker.tar' }}
147+
push: true
148+
tags: ${{ steps.meta.outputs.tags }}
149+
labels: ${{ steps.meta.outputs.labels }}
150+
151+
152+
- name: Build and export as tar ${{ inputs.is_fips == 'true' && ' FIPS' || '' }}
153+
uses: docker/build-push-action@v6
154+
if: inputs.is_publish_to_registry == 'false'
155+
with:
156+
context: opencti-worker
157+
file: opencti-worker/Dockerfile
158+
build-args: |
159+
"BASE_TYPE=${{ inputs.is_fips == 'true' && 'fips' || 'alpine' }}"
160+
push: false
161+
outputs: 'type=docker,dest=/tmp/opencti-worker.tar'
148162
tags: ${{ steps.meta.outputs.tags }}
149163
labels: ${{ steps.meta.outputs.labels }}
150164

0 commit comments

Comments
 (0)