Skip to content

Commit 07be0a7

Browse files
committed
Add push-to-customers in build-docker-artifacts
1 parent 13ae9b9 commit 07be0a7

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

.github/workflows/build-docker-artifacts-push-to-customer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Push docker artifacts to customer (must be infrastructure-k8s)
1+
name: Push docker artifacts to customer (must be run in infrastructure-k8s)
22
run-name: Push ${{ inputs.repository }}:${{ inputs.image_tag }} docker artifacts to ${{ inputs.customer }}
33

44
on:
@@ -41,7 +41,7 @@ jobs:
4141
runs-on: ${{ inputs.runs_on || 'ubuntu-22.04' }}
4242

4343
steps:
44-
- name: Checkout repository (must be infrastructure-k8s)
44+
- name: Checkout repository (must be run in infrastructure-k8s)
4545
uses: actions/checkout@v4
4646
with:
4747
token: ${{ secrets.CHECKOUT_TOKEN || github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}

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

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ jobs:
105105
const result = {
106106
flavors,
107107
components: flattenedComponents,
108+
customers: Object.keys(config.customers).join(','),
108109
};
109110
console.log(result);
110111
return result;
@@ -232,7 +233,7 @@ jobs:
232233
exit 1 #exit execution due to docker image vulnerabilities
233234
fi
234235
235-
post-build:
236+
retag-images:
236237
name: Retag images of flavor ${{ matrix.flavor || 'default' }}
237238
needs: [get-flavors, build-flavors]
238239
strategy:
@@ -288,3 +289,27 @@ jobs:
288289
- name: Log out from Amazon ECR
289290
shell: bash
290291
run: docker logout ${{ steps.login-ecr.outputs.registry }}
292+
293+
push-to-customers:
294+
name: Push images to customers
295+
# if? When should we do this? Always? Only for certain branches? If so, how should we define that, in the config.json?
296+
needs: [retag-images, get-flavors]
297+
uses: datavisyn/github-workflows/.github/workflows/build-docker-artifacts.yml@${{ env.WORKFLOW_BRANCH }}
298+
with:
299+
customers: ${{ fromJson(needs.get-flavors.outputs.result).customers }}
300+
branch: ${{ inputs.branch }}
301+
runs_on: ${{ inputs.runs_on || 'ubuntu-22.04' }}
302+
303+
# steps:
304+
# - name: Checkout github-workflows repository
305+
# uses: actions/checkout@v4
306+
# with:
307+
# repository: datavisyn/github-workflows
308+
# ref: ${{ env.WORKFLOW_BRANCH }}
309+
# path: ./tmp/github-workflows
310+
# - name: Trigger push docker artifacts to ${{ fromJson(needs.get-flavors.outputs.result).customers }}
311+
# uses: ./tmp/github-workflows/.github/actions/build-docker-artifacts-trigger-push-to-customer
312+
# with:
313+
# customers: ${{ fromJson(needs.get-flavors.outputs.result).customers }}
314+
# branch: ${{ inputs.branch }}
315+
# runs_on: ${{ inputs.runs_on || 'ubuntu-22.04' }}

0 commit comments

Comments
 (0)