From 0d03059eaa291b1303a57f1c54a5c20d08a95ea7 Mon Sep 17 00:00:00 2001 From: merlin Date: Mon, 20 Oct 2025 16:40:39 +0800 Subject: [PATCH] fix: ci --- .gitea/workflows/build.yml | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 5506a7e..a6cfe4c 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -7,6 +7,8 @@ on: jobs: build: runs-on: controller + container: + image: harbor.merlin.xin/mirrors/gcr.io/kaniko-project/executor:debug steps: - name: Checkout code run: git clone ${GITEA_INSTANCE_URL}/merlin/test.git @@ -14,18 +16,15 @@ jobs: run: ls - name: Build the Docker image run: | - echo "Building Docker image..." - # image: harbor.merlin.xin/mirrors/gcr.io/kaniko-project/executor:debug - # run: | - # for df in $(find . -name Dockerfile); do - # dir=$(dirname "$df") - # image_name="${vars.REGISTRY_URL}/testing/merlin/$(basename $dir):${gitea.sha:0:7}" - # /kaniko/executor \ - # --dockerfile "$df" \ - # --context "$dir" \ - # --destination "$image_name" \ - # --cache=true \ - # --username "${secrets.HARBOR_USER_NAME}" \ - # --password "${secrets.HARBOR_USER_SECRET}" - # echo "✅ Successfully built and pushed $image_name" - # done \ No newline at end of file + for df in $(find . -name Dockerfile); do + dir=$(dirname "$df") + image_name="${vars.REGISTRY_URL}/testing/merlin/$(basename $dir):${gitea.sha:0:7}" + /kaniko/executor \ + --dockerfile "$df" \ + --context "$dir" \ + --destination "$image_name" \ + --cache=true \ + --username "${secrets.HARBOR_USER_NAME}" \ + --password "${secrets.HARBOR_USER_SECRET}" + echo "✅ Successfully built and pushed $image_name" + done \ No newline at end of file