From ad105bd0c20df949b565ee4bcf9fbadf90ad8fc6 Mon Sep 17 00:00:00 2001
From: chensuyue <suyue.chen@intel.com>
Date: Mon, 4 Nov 2024 23:59:33 +0800
Subject: [PATCH 1/2] fix nightly image publish

Signed-off-by: chensuyue <suyue.chen@intel.com>
---
 .../nightly-docker-build-publish.yml          | 37 +++++++++++--------
 1 file changed, 21 insertions(+), 16 deletions(-)

diff --git a/.github/workflows/nightly-docker-build-publish.yml b/.github/workflows/nightly-docker-build-publish.yml
index fd159d6f09..c6402a7939 100644
--- a/.github/workflows/nightly-docker-build-publish.yml
+++ b/.github/workflows/nightly-docker-build-publish.yml
@@ -4,53 +4,58 @@
 name: Nightly build/publish latest docker images
 
 on:
-  schedule:
-    - cron: "30 1 * * *"
   workflow_dispatch:
 
 env:
-  examples: "AgentQnA,AudioQnA,ChatQnA,CodeGen,CodeTrans,DocIndexRetriever,DocSum,FaqGen,InstructionTuning,MultimodalQnA,ProductivitySuite,RerankFinetuning,SearchQnA,Translation,VideoQnA,VisualQnA"
-  node: gaudi
-  tag: latest
-  publish_tags: latest
+  EXAMPLES: "CodeGen"
+  # EXAMPLES: "AgentQnA,AudioQnA,ChatQnA,CodeGen,CodeTrans,DocIndexRetriever,DocSum,FaqGen,InstructionTuning,MultimodalQnA,ProductivitySuite,RerankFinetuning,SearchQnA,Translation,VideoQnA,VisualQnA"
+  TAG: "latest"
+  PUBLISH_TAGS: "latest"
 
 jobs:
   get-build-matrix:
     runs-on: ubuntu-latest
     outputs:
-      examples: ${{ steps.get-matrix.outputs.examples }}
+      examples_json: ${{ steps.get-matrix.outputs.examples_json }}
+      EXAMPLES: ${{ steps.get-matrix.outputs.EXAMPLES }}
+      TAG: ${{ steps.get-matrix.outputs.TAG }}
+      PUBLISH_TAGS: ${{ steps.get-matrix.outputs.PUBLISH_TAGS }}
     steps:
       - name: Create Matrix
         id: get-matrix
         run: |
-          examples=($(echo ${{ env.examples }} | tr ',' ' '))
+          examples=($(echo ${EXAMPLES} | tr ',' ' '))
           examples_json=$(printf '%s\n' "${examples[@]}" | sort -u | jq -R '.' | jq -sc '.')
-          echo "examples=$examples_json" >> $GITHUB_OUTPUT
+          echo "examples_json=$examples_json" >> $GITHUB_OUTPUT
+          echo "EXAMPLES=$EXAMPLES" >> $GITHUB_OUTPUT
+          echo "TAG=$TAG" >> $GITHUB_OUTPUT
+          echo "PUBLISH_TAGS=$PUBLISH_TAGS" >> $GITHUB_OUTPUT
 
   build:
     needs: get-build-matrix
     strategy:
       matrix:
-        example: ${{ fromJSON(needs.get-build-matrix.outputs.examples) }}
+        example: ${{ fromJSON(needs.get-build-matrix.outputs.examples_json) }}
       fail-fast: false
     uses: ./.github/workflows/_example-workflow.yml
     with:
-      node: ${{ env.node }}
+      node: gaudi
       example: ${{ matrix.example }}
       inject_commit: true
     secrets: inherit
 
   get-image-list:
+    needs: get-build-matrix
     uses: ./.github/workflows/_get-image-list.yml
     with:
-      examples: ${{ env.examples }}
+      examples: ${{ needs.get-build-matrix.outputs.EXAMPLES }}
 
   publish:
-    needs: [get-image-list, build]
+    needs: [get-build-matrix, get-image-list, build]
     strategy:
       matrix:
         image: ${{ fromJSON(needs.get-image-list.outputs.matrix) }}
-    runs-on: "docker-build-${{ env.node }}"
+    runs-on: "docker-build-gaudi"
     steps:
       - uses: docker/login-action@v3.2.0
         with:
@@ -60,6 +65,6 @@ jobs:
       - name: Image Publish
         uses: opea-project/validation/actions/image-publish@main
         with:
-          local_image_ref: ${OPEA_IMAGE_REPO}opea/${{ matrix.image }}:${{ env.tag }}
+          local_image_ref: ${OPEA_IMAGE_REPO}opea/${{ matrix.image }}:${{ needs.get-build-matrix.outputs.TAG }}
           image_name: opea/${{ matrix.image }}
-          publish_tags: ${{ env.publish_tags }}
+          publish_tags: ${{ needs.get-build-matrix.outputs.PUBLISH_TAGS }}

From 9b353fe2171dc9119364d9012ea850386f786bec Mon Sep 17 00:00:00 2001
From: chensuyue <suyue.chen@intel.com>
Date: Tue, 5 Nov 2024 00:03:30 +0800
Subject: [PATCH 2/2] remove test code

Signed-off-by: chensuyue <suyue.chen@intel.com>
---
 .github/workflows/nightly-docker-build-publish.yml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/nightly-docker-build-publish.yml b/.github/workflows/nightly-docker-build-publish.yml
index c6402a7939..275e1862b7 100644
--- a/.github/workflows/nightly-docker-build-publish.yml
+++ b/.github/workflows/nightly-docker-build-publish.yml
@@ -4,11 +4,12 @@
 name: Nightly build/publish latest docker images
 
 on:
+  schedule:
+    - cron: "30 1 * * *"
   workflow_dispatch:
 
 env:
-  EXAMPLES: "CodeGen"
-  # EXAMPLES: "AgentQnA,AudioQnA,ChatQnA,CodeGen,CodeTrans,DocIndexRetriever,DocSum,FaqGen,InstructionTuning,MultimodalQnA,ProductivitySuite,RerankFinetuning,SearchQnA,Translation,VideoQnA,VisualQnA"
+  EXAMPLES: "AgentQnA,AudioQnA,ChatQnA,CodeGen,CodeTrans,DocIndexRetriever,DocSum,FaqGen,InstructionTuning,MultimodalQnA,ProductivitySuite,RerankFinetuning,SearchQnA,Translation,VideoQnA,VisualQnA"
   TAG: "latest"
   PUBLISH_TAGS: "latest"
 
