From 2e191bb395748470a1a624fc51afdcd04c0946d1 Mon Sep 17 00:00:00 2001 From: pooneyy <85266337+pooneyy@users.noreply.github.com> Date: Fri, 3 Oct 2025 16:02:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=A7=20chore(ci):=20fix=20docker=20?= =?UTF-8?q?build=20args=20variable=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - correct variable name from `repo` to `build_args` in docker build workflow --- .github/workflows/build-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 4c51f93e2..455f09d22 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -161,7 +161,7 @@ jobs: uses: docker/build-push-action@v6 with: build-args: | - ${{ github.event.inputs.repo }} + ${{ github.event.inputs.build_args }} context: . target: ${{ github.event.inputs.build_target }} push: true From 91aa0ab5256de745c9410e7c71c0b4a8fdd54644 Mon Sep 17 00:00:00 2001 From: pooneyy <85266337+pooneyy@users.noreply.github.com> Date: Fri, 3 Oct 2025 20:54:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=91=B7=20ci(docker):=20add=20build=20?= =?UTF-8?q?context=20parameter=20to=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add build_context input parameter with default value of current directory - update docker build step to use dynamic build context from workflow input --- .github/workflows/build-docker-image.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 455f09d22..8b8cd65ae 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -24,6 +24,12 @@ on: default: latest type: string + build_context: + description: 构建上下文目录 + required: false + type: string + default: . + dockerfile: description: Dockerfile 在仓库中的路径 required: false @@ -67,6 +73,7 @@ jobs: TARGET_REF: ${{ github.event.inputs.ref }} IMAGE_NAME: ${{ github.event.inputs.image_name }} IMAGE_TAG: ${{ github.event.inputs.image_tag }} + BUILD_CONTEXT: ${{ github.event.inputs.build_context }} DOCKERFILE: ${{ github.event.inputs.dockerfile }} ARCHITECTURES: ${{ github.event.inputs.architectures }} BUILD_ARGS: ${{ github.event.inputs.build_args }} @@ -76,6 +83,7 @@ jobs: echo "TARGET_REF=$TARGET_REF" echo "IMAGE_NAME=$IMAGE_NAME" echo "IMAGE_TAG=$IMAGE_TAG" + echo "BUILD_CONTEXT=$BUILD_CONTEXT" echo "DOCKERFILE=$DOCKERFILE" echo "ARCHITECTURES=$ARCHITECTURES" echo "BUILD_ARGS=$BUILD_ARGS" @@ -162,7 +170,7 @@ jobs: with: build-args: | ${{ github.event.inputs.build_args }} - context: . + context: ${{ github.event.inputs.build_context}} target: ${{ github.event.inputs.build_target }} push: true file: ${{ github.event.inputs.dockerfile }}