@@ -255,12 +255,36 @@ jobs:
255255 - name : Push image
256256 uses : docker/build-push-action@v6
257257 with :
258+ context : .
258259 file : ${{ matrix.component.flavor_directory }}/${{ matrix.component.directory }}/Dockerfile
259260 push : true
261+ # Disable provenance as it creates weird multi-arch images: https://github.com/docker/build-push-action/issues/755
260262 provenance : false
261- context : .
263+ # Duplicated the build-args, secrets, tags and labels from the actual build above
264+ # TODO: How can we avoid the build here and just push with this action?
265+ build-args : |
266+ DOCKERFILE_DIRECTORY=${{ matrix.component.flavor_directory }}/${{ matrix.component.directory }}
267+ PYTHON_BASE_IMAGE=${{ env.PYTHON_BASE_IMAGE }}
268+ DATAVISYN_PYTHON_BASE_IMAGE=${{ env.DATAVISYN_PYTHON_BASE_IMAGE }}
269+ NODE_BASE_IMAGE=${{ env.NODE_BASE_IMAGE }}
270+ DATAVISYN_NGINX_BASE_IMAGE=${{ env.DATAVISYN_NGINX_BASE_IMAGE }}
271+ secrets :
272+ # Mount the token as secret mount: https://docs.docker.com/build/ci/github-actions/secrets/#secret-mounts
273+ " github_token=${{ secrets.CHECKOUT_TOKEN || github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}"
274+ # TODO: As soon as we only have a single tag, we can push the same image to multiple repositories: https://docs.docker.com/build/ci/github-actions/push-multi-registries/
275+ # This will be useful for the images which don't change between flavors, e.g. the backend images
262276 tags : |
263277 ${{ vars.DV_AWS_ECR_REGISTRY }}/${{ matrix.component.ecr_repository }}:${{ matrix.component.image_tag }}
278+ labels : |
279+ name=${{ matrix.component.ecr_repository }}
280+ version=${{ matrix.component.image_tag_branch_name }}
281+ org.opencontainers.image.description=Image for ${{ matrix.component.ecr_repository }}
282+ org.opencontainers.image.source=${{ github.event.repository.html_url }}
283+ org.opencontainers.image.url=${{ github.event.repository.html_url }}
284+ org.opencontainers.image.title=${{ matrix.component.ecr_repository }}
285+ org.opencontainers.image.version=${{ matrix.component.image_tag_branch_name }}
286+ org.opencontainers.image.created=${{ matrix.component.build_time }}
287+ org.opencontainers.image.revision=${{ github.sha }}
264288
265289 - name : Log out from Amazon ECR
266290 shell : bash
0 commit comments