diff --git a/.github/workflows/E2E_test_with_compose.yml b/.github/workflows/docker-compose-e2e.yml
similarity index 79%
rename from .github/workflows/E2E_test_with_compose.yml
rename to .github/workflows/docker-compose-e2e.yml
index ab7c2b239e..07e16a32af 100644
--- a/.github/workflows/E2E_test_with_compose.yml
+++ b/.github/workflows/docker-compose-e2e.yml
@@ -4,7 +4,8 @@
 name: E2E test with docker compose
 
 on:
-  pull_request_target:
+  #pull_request_target:
+  pull_request:
     branches: [main]
     types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped
     paths:
@@ -13,7 +14,7 @@ on:
       - "**/ui/**"
       - "!**.md"
       - "!**.txt"
-      - .github/workflows/E2E_test_with_compose.yml
+      - .github/workflows/docker-compose-e2e.yml
   workflow_dispatch:
 
 # If there is a new commit, the previous jobs will be canceled
@@ -25,10 +26,19 @@ jobs:
   job1:
     uses: ./.github/workflows/reuse-get-test-matrix.yml
     with:
-      diff-excluded-files: '.github|README.md|*.txt|deprecate|kubernetes|manifest|assets'
+      diff_excluded_files: '.github|README.md|*.txt|deprecate|kubernetes|manifest|assets'
 
-  Example-test:
+  mega-image-build:
     needs: job1
+    strategy:
+      matrix: ${{ fromJSON(needs.job1.outputs.run_matrix) }}
+    uses: ./.github/workflows/reuse-image-build.yml
+    with:
+      image_tag: ${{ github.event.pull_request.head.sha }}
+      mega_service: "${{ matrix.example }}"
+
+  Example-test:
+    needs: [job1, mega-image-build]
     strategy:
       matrix: ${{ fromJSON(needs.job1.outputs.run_matrix) }}
     runs-on: ${{ matrix.hardware }}
@@ -51,6 +61,8 @@ jobs:
           HUGGINGFACEHUB_API_TOKEN: ${{ secrets.HUGGINGFACEHUB_API_TOKEN }}
           example: ${{ matrix.example }}
           hardware: ${{ matrix.hardware }}
+          IMAGE_REPO: ${{needs.mega-image-build.outputs.image_repo}}
+          IMAGE_TAG: ${{needs.mega-image-build.outputs.image_tag}}
         run: |
           cd ${{ github.workspace }}/$example/tests
           example_l=$(echo $example | tr '[:upper:]' '[:lower:]')
@@ -60,7 +72,7 @@ jobs:
         env:
           example: ${{ matrix.example }}
           hardware: ${{ matrix.hardware }}
-        if: cancelled() || failure()
+        if: $${{ matrix.hardware }} != 'xeon' && cancelled() || failure()
         run: |
           cd ${{ github.workspace }}/$example/docker/$hardware
           container_list=$(cat docker_compose.yaml | grep container_name | cut -d':' -f2)
diff --git a/.github/workflows/image-build-on-push.yml b/.github/workflows/image-build-on-push.yml
new file mode 100644
index 0000000000..ce5323c866
--- /dev/null
+++ b/.github/workflows/image-build-on-push.yml
@@ -0,0 +1,30 @@
+# Copyright (C) 2024 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+# Test
+name: Build latest images on push event
+
+on:
+  push:
+    branches: [ 'main' ]
+    paths:
+      - "**/docker/*.py"
+      - "**/docker/Dockerfile"
+      - "**/docker/ui/**"
+  workflow_dispatch:
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}-on-push
+  cancel-in-progress: true
+
+jobs:
+  job1:
+    uses: ./.github/workflows/reuse-get-test-matrix.yml
+
+  mega-image-build:
+    needs: job1
+    strategy:
+      matrix: ${{ fromJSON(needs.job1.outputs.run_matrix) }}
+    uses: ./.github/workflows/reuse-image-build.yml
+    with:
+      image-tag: latest
+      mega-service: "${{ matrix.example }}"
diff --git a/.github/workflows/manifest-e2e.yml b/.github/workflows/manifest-e2e.yml
index 4ce977bd60..902d265988 100644
--- a/.github/workflows/manifest-e2e.yml
+++ b/.github/workflows/manifest-e2e.yml
@@ -23,9 +23,9 @@ jobs:
   job1:
     uses: ./.github/workflows/reuse-get-test-matrix.yml
     with:
-      diff-excluded-files: '.github|deprecated|docker|assets'
-      xeon-server-lable: 'k8s'
-      gaudi-server-lable: ""
+      diff_excluded_files: '.github|deprecated|docker|assets|*.md|*.txt'
+      xeon_server_lable: 'k8s'
+      gaudi_server_lable: ""
 
   mega-image-build:
     needs: job1
@@ -33,8 +33,8 @@ jobs:
       matrix: ${{ fromJSON(needs.job1.outputs.run_matrix) }}
     uses: ./.github/workflows/reuse-image-build.yml
     with:
-      image-tag: ${{ github.event.pull_request.head.sha }}
-      mega-service: "${{ matrix.example }}"
+      image_tag: ${{ github.event.pull_request.head.sha }}
+      mega_service: "${{ matrix.example }}"
 
   manifest-test:
     needs: [job1, mega-image-build]
@@ -57,8 +57,8 @@ jobs:
 
       - name: Set variables
         run: |
-          echo "IMAGE_REPO=${OPEA_IMAGE_REPO}/" >> $GITHUB_ENV
-          echo "IMAGE_TAG=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
+          echo "IMAGE_REPO=${{needs.mega-image-build.outputs.image_repo}}" >> $GITHUB_ENV
+          echo "IMAGE_TAG=${{needs.mega-image-build.outputs.image_tag}}" >> $GITHUB_ENV
           lower_example=$(echo "${{ matrix.example }}" | tr '[:upper:]' '[:lower:]')
           echo "NAMESPACE=$lower_example-$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV
           echo "ROLLOUT_TIMEOUT_SECONDS=1800s" >> $GITHUB_ENV
diff --git a/.github/workflows/reuse-get-test-matrix.yml b/.github/workflows/reuse-get-test-matrix.yml
index 3c382df2b2..c2258024e5 100644
--- a/.github/workflows/reuse-get-test-matrix.yml
+++ b/.github/workflows/reuse-get-test-matrix.yml
@@ -1,20 +1,21 @@
 # Copyright (C) 2024 Intel Corporation
 # SPDX-License-Identifier: Apache-2.0
 
+# Support push and pull_request events
 name: Get Test Matrix
 permissions: read-all
 on:
   workflow_call:
     inputs:
-      diff-excluded-files:
+      diff_excluded_files:
         required: false
         type: string
         default: '.github|README.md|*.txt'
-      xeon-server-lable:
+      xeon_server_lable:
         required: false
         type: string
         default: 'xeon'
-      gaudi-server-lable:
+      gaudi_server_lable:
         required: false
         type: string
         default: 'gaudi'
@@ -30,19 +31,33 @@ jobs:
     outputs:
       run_matrix: ${{ steps.get-test-matrix.outputs.run_matrix }}
     steps:
+      - name: Get checkout ref
+        run: |
+          if [ "${{ github.event_name }}" == "pull_request" ] || [ "${{ github.event_name }}" == "pull_request_target" ]; then
+            echo "CHECKOUT_REF=refs/pull/${{ github.event.number }}/merge" >> $GITHUB_ENV
+          else
+            echo "CHECKOUT_REF=${{ github.ref }}" >> $GITHUB_ENV
+          fi
+          echo "checkout ref ${{ env.CHECKOUT_REF }}"
+
       - name: Checkout out Repo
         uses: actions/checkout@v4
         with:
-          ref: "refs/pull/${{ github.event.number }}/merge"
+          ref: ${{ env.CHECKOUT_REF }}
           fetch-depth: 0
 
       - name: Get test matrix
         id: get-test-matrix
         run: |
           set -xe
+          if [ "${{ github.event_name }}" == "pull_request" ] || [ "${{ github.event_name }}" == "pull_request_target" ]; then
+            base_commit=${{ github.event.pull_request.base.sha }}
+          else
+            base_commit=$(git rev-parse HEAD~1) # push event
+          fi
           merged_commit=$(git log -1 --format='%H')
-          changed_files="$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${merged_commit} | \
-          grep -vE '${{ inputs.diff-excluded-files }}')" || true
+          changed_files="$(git diff --name-only ${base_commit} ${merged_commit} | \
+          grep -vE '${{ inputs.diff_excluded_files }}')" || true
           examples=$(printf '%s\n' "${changed_files[@]}" | grep '/' | cut -d'/' -f1 | sort -u)
           run_matrix="{\"include\":["
           for example in ${examples}; do
@@ -51,10 +66,10 @@ jobs:
               if [ $(printf '%s\n' "${changed_files[@]}" | grep ${example} | grep -c xeon) != 0 ]; then run_hardware="xeon ${run_hardware}"; fi
               if [ "$run_hardware" = "" ]; then run_hardware="xeon"; fi
               for hw in ${run_hardware}; do
-                  if [ $hw = "gaudi" && ${{ inputs.gaudi-server-lable }} != ""]; then
-                    run_matrix="${run_matrix}{\"example\":\"${example}\",\"hardware\":\"${{ inputs.gaudi-server-lable }}\"},"
-                  elif [ ${{ inputs.xeon-server-lable }} != "" ]; then
-                    run_matrix="${run_matrix}{\"example\":\"${example}\",\"hardware\":\"${{ inputs.xeon-server-lable }}\"},"
+                  if [ $hw = "gaudi" ] && [ ${{ inputs.gaudi_server_lable }} != ""]; then
+                    run_matrix="${run_matrix}{\"example\":\"${example}\",\"hardware\":\"${{ inputs.gaudi_server_lable }}\"},"
+                  elif [ ${{ inputs.xeon_server_lable }} != "" ]; then
+                    run_matrix="${run_matrix}{\"example\":\"${example}\",\"hardware\":\"${{ inputs.xeon_server_lable }}\"},"
                   fi
               done
           done
diff --git a/.github/workflows/reuse-image-build.yml b/.github/workflows/reuse-image-build.yml
index 6ac90f81e6..8b20540710 100644
--- a/.github/workflows/reuse-image-build.yml
+++ b/.github/workflows/reuse-image-build.yml
@@ -6,19 +6,26 @@ permissions: read-all
 on:
   workflow_call:
     inputs:
-      image-repo:
+      image_repo:
         required: false
         type: string
-      image-tag:
+      image_tag:
         required: true
         type: string
-      mega-service:
+      mega_service:
         required: true
         type: string
       runner_lable:
         required: false
         type: string
         default: 'docker-build'
+    outputs:
+      image_repo:
+        description: "The image reposity used for the image build"
+        value: ${{ jobs.mega-image-build.outputs.image_repo }}
+      image_tag:
+        description: "The image tag used for the image build"
+        value: ${{ jobs.mega-image-build.outputs.image_tag }}
 
 concurrency:
   group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-image-build
@@ -26,6 +33,9 @@ concurrency:
 jobs:
   mega-image-build:
     runs-on: ${{ inputs.runner_lable }}
+    outputs:
+      image_repo: ${{ steps.build-megaservice-image.outputs.image_repo }}
+      image_tag: ${{ steps.build-megaservice-image.outputs.image_tag }}
     steps:
       - name: Checkout out Repo
         uses: actions/checkout@v4
@@ -35,8 +45,15 @@ jobs:
       - name: Building MegaService Docker Image
         id: build-megaservice-image
         env:
-          IMAGE_REPO: ${{ inputs.image-repo }}
-          IMAGE_TAG: ${{ inputs.image-tag }}
-          mega-service: ${{ inputs.mega-service }}
+          IMAGE_REPO: ${{ inputs.image_repo }}
+          IMAGE_TAG: ${{ inputs.image_tag }}
+          MEGA_SERVICE: ${{ inputs.mega_service }}
         run: |
-          .github/workflows/scripts/build_push.sh ${{ env.mega-service}}
+          .github/workflows/scripts/build_push.sh ${{ env.MEGA_SERVICE}}
+          if [ -z "${{ env.IMAGE_REPO }}" ]; then
+            IMAGE_REPO=$OPEA_IMAGE_REPO
+          fi
+          echo "IMAGE_REPO=${IMAGE_REPO}"
+          echo "IMAGE_TAG=${IMAGE_TAG}"
+          echo "image_repo=$IMAGE_REPO" >> $GITHUB_OUTPUT
+          echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT
diff --git a/.github/workflows/scripts/build_push.sh b/.github/workflows/scripts/build_push.sh
index d72511cff7..7d68eff347 100755
--- a/.github/workflows/scripts/build_push.sh
+++ b/.github/workflows/scripts/build_push.sh
@@ -22,7 +22,7 @@ function checkExist() {
 
 function docker_build() {
     # check if if IMAGE_TAG is not "latest" and the image exists in the registry
-    if [ $IMAGE_TAG != "latest" && $(checkExist $1) == "true" ]; then
+    if [[$IMAGE_TAG != "latest"] && ["$(checkExist $1)" == "true"]]; then
         echo "Image ${IMAGE_REPO}opea/$1:$IMAGE_TAG already exists in the registry"
         return
     fi
@@ -35,7 +35,8 @@ function docker_build() {
     echo "Building ${IMAGE_REPO}opea/$1:$IMAGE_TAG using Dockerfile $DOCKERFILE_PATH"
     # if https_proxy and http_proxy are set, pass them to docker build
     if [ -z "$https_proxy" ]; then
-        docker build --no-cache -t ${IMAGE_REPO}opea/$1:$IMAGE_TAG -f $DOCKERFILE_PATH .
+        #docker build --no-cache -t ${IMAGE_REPO}opea/$1:$IMAGE_TAG -f $DOCKERFILE_PATH .
+        docker build -t ${IMAGE_REPO}opea/$1:$IMAGE_TAG -f $DOCKERFILE_PATH .
     else
         docker build --no-cache -t ${IMAGE_REPO}opea/$1:$IMAGE_TAG --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f $DOCKERFILE_PATH .
     fi
diff --git a/CodeGen/tests/test_codegen_on_xeon.sh b/CodeGen/tests/test_codegen_on_xeon.sh
index 0b3beb0271..fd22887b5a 100644
--- a/CodeGen/tests/test_codegen_on_xeon.sh
+++ b/CodeGen/tests/test_codegen_on_xeon.sh
@@ -36,8 +36,11 @@ function start_services() {
 
     sed -i "s/backend_address/$ip_address/g" $WORKPATH/docker/ui/svelte/.env
 
+    # Replace the container name with a test-specific name
+    echo "using image repository $IMAGE_REPO and image tag $IMAGE_TAG"
+    sed -i "s#image: opea/codegen:latest#image: opea/codegen:${IMAGE_TAG}#g" docker_compose.yaml
+    sed -i "s#image: opea/*#image: ${IMAGE_REPO}opea/#g" docker_compose.yaml
     # Start Docker Containers
-    # TODO: Replace the container name with a test-specific name
     docker compose -f docker_compose.yaml up -d
 
     sleep 2m # Waits 2 minutes
@@ -140,7 +143,7 @@ function main() {
 
     stop_docker
 
-    build_docker_images
+    # build_docker_images
     start_services
 
     validate_microservices
