From 51d97198eb278314bfb930c9297822f4cf7ecda7 Mon Sep 17 00:00:00 2001 From: konpure <104032111@qq.com> Date: Mon, 4 Aug 2025 14:03:50 +0800 Subject: [PATCH 1/7] add release-image.yml --- .github/workflows/release-image-amd64.yml | 0 .github/workflows/release-image-api.yml | 63 +++++++++++++++++++++++ .github/workflows/release-image-arm64.yml | 0 .github/workflows/release-image-web.yml | 63 +++++++++++++++++++++++ 4 files changed, 126 insertions(+) create mode 100644 .github/workflows/release-image-amd64.yml create mode 100644 .github/workflows/release-image-api.yml create mode 100644 .github/workflows/release-image-arm64.yml create mode 100644 .github/workflows/release-image-web.yml diff --git a/.github/workflows/release-image-amd64.yml b/.github/workflows/release-image-amd64.yml new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/.github/workflows/release-image-api.yml b/.github/workflows/release-image-api.yml new file mode 100644 index 00000000000000..979af9fe548f5a --- /dev/null +++ b/.github/workflows/release-image-api.yml @@ -0,0 +1,63 @@ +name: Build and Push Dify API Docker Image (Separate AMD64 & ARM64 tags) + +on: + workflow_dispatch: + inputs: + tag: + description: 'The tag to release' + required: true + push: + branches: [release-ci] + pull_request: + types: [closed] + branches: [release-ci] + +concurrency: + group: build-push-${{ github.run_id }} + cancel-in-progress: true + +env: + REGISTRY_HOST: registry.cn-hangzhou.aliyuncs.com + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} + IMAGE_BASE: ${{ env.REGISTRY_HOST }}/kindlingx/apo-dify-api + +jobs: + build-api: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Login to Aliyun Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY_HOST }} + username: ${{ env.DOCKERHUB_USERNAME }} + password: ${{ env.DOCKERHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build & push AMD64 image + uses: docker/build-push-action@v6 + with: + context: "{{defaultContext}}:api" + platforms: linux/amd64 + push: true + tags: ${{ env.IMAGE_BASE }}:${{ inputs.tag }} + cache-from: type=gha,scope=dify-api-amd64 + cache-to: type=gha,mode=max,scope=dify-api-amd64 + + - name: Build & push ARM64 image + uses: docker/build-push-action@v6 + with: + context: "{{defaultContext}}:api" + platforms: linux/arm64 + push: true + tags: ${{ env.IMAGE_BASE }}:${{ inputs.tag }}-arm64 + cache-from: type=gha,scope=dify-api-arm64 + cache-to: type=gha,mode=max,scope=dify-api-arm64 \ No newline at end of file diff --git a/.github/workflows/release-image-arm64.yml b/.github/workflows/release-image-arm64.yml new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/.github/workflows/release-image-web.yml b/.github/workflows/release-image-web.yml new file mode 100644 index 00000000000000..0f0614b9f05d46 --- /dev/null +++ b/.github/workflows/release-image-web.yml @@ -0,0 +1,63 @@ +name: Build and Push Dify Web Docker Image (Separate AMD64 & ARM64 tags) + +on: + workflow_dispatch: + inputs: + tag: + description: 'The tag to release' + required: true + push: + branches: [release-ci] + pull_request: + types: [closed] + branches: [release-ci] + +concurrency: + group: build-push-${{ github.run_id }} + cancel-in-progress: true + +env: + REGISTRY_HOST: registry.cn-hangzhou.aliyuncs.com + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} + IMAGE_BASE: ${{ env.REGISTRY_HOST }}/kindlingx/apo-dify-web + +jobs: + build-web: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Login to Aliyun Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY_HOST }} + username: ${{ env.DOCKERHUB_USERNAME }} + password: ${{ env.DOCKERHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build & push AMD64 image + uses: docker/build-push-action@v6 + with: + context: "{{defaultContext}}:web" + platforms: linux/amd64 + push: true + tags: ${{ env.IMAGE_BASE }}:${{ inputs.tag }} + cache-from: type=gha,scope=dify-web-amd64 + cache-to: type=gha,mode=max,scope=dify-web-amd64 + + - name: Build & push ARM64 image + uses: docker/build-push-action@v6 + with: + context: "{{defaultContext}}:web" + platforms: linux/arm64 + push: true + tags: ${{ env.IMAGE_BASE }}:${{ inputs.tag }}-arm64 + cache-from: type=gha,scope=dify-web-arm64 + cache-to: type=gha,mode=max,scope=dify-web-arm64 \ No newline at end of file From 405d9b756b80595399e0f90e03f7a318c20161b3 Mon Sep 17 00:00:00 2001 From: konpure <104032111@qq.com> Date: Mon, 4 Aug 2025 14:12:21 +0800 Subject: [PATCH 2/7] remove empty workflow files from remote --- .github/workflows/release-image-amd64.yml | 0 .github/workflows/release-image-arm64.yml | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .github/workflows/release-image-amd64.yml delete mode 100644 .github/workflows/release-image-arm64.yml diff --git a/.github/workflows/release-image-amd64.yml b/.github/workflows/release-image-amd64.yml deleted file mode 100644 index e69de29bb2d1d6..00000000000000 diff --git a/.github/workflows/release-image-arm64.yml b/.github/workflows/release-image-arm64.yml deleted file mode 100644 index e69de29bb2d1d6..00000000000000 From 5321a1658a8148d5b108272065284b83b61f7c07 Mon Sep 17 00:00:00 2001 From: konpure <104032111@qq.com> Date: Mon, 4 Aug 2025 14:29:10 +0800 Subject: [PATCH 3/7] update release file --- .github/workflows/release-image-api.yml | 6 ++++++ .github/workflows/release-image-web.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/release-image-api.yml b/.github/workflows/release-image-api.yml index 979af9fe548f5a..2dcc71e450bfc2 100644 --- a/.github/workflows/release-image-api.yml +++ b/.github/workflows/release-image-api.yml @@ -27,9 +27,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout + if: github.event_name == 'workflow_dispatch' uses: actions/checkout@v2 - name: Login to Aliyun Registry + if: github.event_name == 'workflow_dispatch' uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY_HOST }} @@ -37,12 +39,15 @@ jobs: password: ${{ env.DOCKERHUB_TOKEN }} - name: Set up QEMU + if: github.event_name == 'workflow_dispatch' uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx + if: github.event_name == 'workflow_dispatch' uses: docker/setup-buildx-action@v3 - name: Build & push AMD64 image + if: github.event_name == 'workflow_dispatch' uses: docker/build-push-action@v6 with: context: "{{defaultContext}}:api" @@ -53,6 +58,7 @@ jobs: cache-to: type=gha,mode=max,scope=dify-api-amd64 - name: Build & push ARM64 image + if: github.event_name == 'workflow_dispatch' uses: docker/build-push-action@v6 with: context: "{{defaultContext}}:api" diff --git a/.github/workflows/release-image-web.yml b/.github/workflows/release-image-web.yml index 0f0614b9f05d46..80eedfe4d27479 100644 --- a/.github/workflows/release-image-web.yml +++ b/.github/workflows/release-image-web.yml @@ -27,9 +27,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout + if: github.event_name == 'workflow_dispatch' uses: actions/checkout@v2 - name: Login to Aliyun Registry + if: github.event_name == 'workflow_dispatch' uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY_HOST }} @@ -37,12 +39,15 @@ jobs: password: ${{ env.DOCKERHUB_TOKEN }} - name: Set up QEMU + if: github.event_name == 'workflow_dispatch' uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx + if: github.event_name == 'workflow_dispatch' uses: docker/setup-buildx-action@v3 - name: Build & push AMD64 image + if: github.event_name == 'workflow_dispatch' uses: docker/build-push-action@v6 with: context: "{{defaultContext}}:web" @@ -53,6 +58,7 @@ jobs: cache-to: type=gha,mode=max,scope=dify-web-amd64 - name: Build & push ARM64 image + if: github.event_name == 'workflow_dispatch' uses: docker/build-push-action@v6 with: context: "{{defaultContext}}:web" From 8d92386d90f21edacbf1f213ee2e353cd98b24c9 Mon Sep 17 00:00:00 2001 From: konpure <104032111@qq.com> Date: Mon, 4 Aug 2025 16:51:58 +0800 Subject: [PATCH 4/7] fix image env --- .github/workflows/release-image-api.yml | 5 ++--- .github/workflows/release-image-web.yml | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-image-api.yml b/.github/workflows/release-image-api.yml index 2dcc71e450bfc2..9d35e4b874a74d 100644 --- a/.github/workflows/release-image-api.yml +++ b/.github/workflows/release-image-api.yml @@ -20,7 +20,6 @@ env: REGISTRY_HOST: registry.cn-hangzhou.aliyuncs.com DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - IMAGE_BASE: ${{ env.REGISTRY_HOST }}/kindlingx/apo-dify-api jobs: build-api: @@ -53,7 +52,7 @@ jobs: context: "{{defaultContext}}:api" platforms: linux/amd64 push: true - tags: ${{ env.IMAGE_BASE }}:${{ inputs.tag }} + tags: ${{ env.REGISTRY_HOST }}/kindlingx/apo-dify-api:${{ inputs.tag }} cache-from: type=gha,scope=dify-api-amd64 cache-to: type=gha,mode=max,scope=dify-api-amd64 @@ -64,6 +63,6 @@ jobs: context: "{{defaultContext}}:api" platforms: linux/arm64 push: true - tags: ${{ env.IMAGE_BASE }}:${{ inputs.tag }}-arm64 + tags: ${{ env.REGISTRY_HOST }}/kindlingx/apo-dify-api:${{ inputs.tag }}-arm64 cache-from: type=gha,scope=dify-api-arm64 cache-to: type=gha,mode=max,scope=dify-api-arm64 \ No newline at end of file diff --git a/.github/workflows/release-image-web.yml b/.github/workflows/release-image-web.yml index 80eedfe4d27479..e8ab79e8c729d1 100644 --- a/.github/workflows/release-image-web.yml +++ b/.github/workflows/release-image-web.yml @@ -53,7 +53,7 @@ jobs: context: "{{defaultContext}}:web" platforms: linux/amd64 push: true - tags: ${{ env.IMAGE_BASE }}:${{ inputs.tag }} + tags: ${{ env.REGISTRY_HOST }}/kindlingx/apo-dify-web:${{ inputs.tag }} cache-from: type=gha,scope=dify-web-amd64 cache-to: type=gha,mode=max,scope=dify-web-amd64 @@ -64,6 +64,6 @@ jobs: context: "{{defaultContext}}:web" platforms: linux/arm64 push: true - tags: ${{ env.IMAGE_BASE }}:${{ inputs.tag }}-arm64 + tags: ${{ env.REGISTRY_HOST }}/kindlingx/apo-dify-web:${{ inputs.tag }}-arm64 cache-from: type=gha,scope=dify-web-arm64 cache-to: type=gha,mode=max,scope=dify-web-arm64 \ No newline at end of file From fcb900fdc79adbc899dca4507d52e5a211187403 Mon Sep 17 00:00:00 2001 From: konpure <104032111@qq.com> Date: Tue, 5 Aug 2025 10:59:09 +0800 Subject: [PATCH 5/7] fix image env --- .github/workflows/release-image-web.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release-image-web.yml b/.github/workflows/release-image-web.yml index e8ab79e8c729d1..c658bfcaf5ff4c 100644 --- a/.github/workflows/release-image-web.yml +++ b/.github/workflows/release-image-web.yml @@ -20,7 +20,6 @@ env: REGISTRY_HOST: registry.cn-hangzhou.aliyuncs.com DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - IMAGE_BASE: ${{ env.REGISTRY_HOST }}/kindlingx/apo-dify-web jobs: build-web: From af7f5f89cb260df11fb7f466f17e9f77dbe53395 Mon Sep 17 00:00:00 2001 From: konpure <104032111@qq.com> Date: Tue, 5 Aug 2025 13:56:12 +0800 Subject: [PATCH 6/7] add push tag --- .github/workflows/release-image-api.yml | 9 ++++++++- .github/workflows/release-image-web.yml | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-image-api.yml b/.github/workflows/release-image-api.yml index 2318d2feee63ef..96caae95246dc9 100644 --- a/.github/workflows/release-image-api.yml +++ b/.github/workflows/release-image-api.yml @@ -66,4 +66,11 @@ jobs: push: true tags: ${{ env.REGISTRY_HOST }}/kindlingx/apo-dify-api:${{ inputs.tag }}-arm64 cache-from: type=gha,scope=dify-api-arm64 - cache-to: type=gha,mode=max,scope=dify-api-arm64 \ No newline at end of file + cache-to: type=gha,mode=max,scope=dify-api-arm64 + + - name: push tag + if: github.event_name == 'workflow_dispatch' + uses: anothrNick/github-tag-action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CUSTOM_TAG: ${{ github.event.inputs.tag }} \ No newline at end of file diff --git a/.github/workflows/release-image-web.yml b/.github/workflows/release-image-web.yml index c658bfcaf5ff4c..06460bdc90aeb2 100644 --- a/.github/workflows/release-image-web.yml +++ b/.github/workflows/release-image-web.yml @@ -65,4 +65,11 @@ jobs: push: true tags: ${{ env.REGISTRY_HOST }}/kindlingx/apo-dify-web:${{ inputs.tag }}-arm64 cache-from: type=gha,scope=dify-web-arm64 - cache-to: type=gha,mode=max,scope=dify-web-arm64 \ No newline at end of file + cache-to: type=gha,mode=max,scope=dify-web-arm64 + + - name: push tag + if: github.event_name == 'workflow_dispatch' + uses: anothrNick/github-tag-action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CUSTOM_TAG: ${{ github.event.inputs.tag }} \ No newline at end of file From acfb1df8e385f1c0d1ba2a7e5a90f86807ca5f95 Mon Sep 17 00:00:00 2001 From: konpure <104032111@qq.com> Date: Tue, 12 Aug 2025 19:46:10 +0800 Subject: [PATCH 7/7] fix arm repo --- .github/workflows/release-image-api.yml | 2 +- .github/workflows/release-image-web.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-image-api.yml b/.github/workflows/release-image-api.yml index 96caae95246dc9..8a03868cd319ef 100644 --- a/.github/workflows/release-image-api.yml +++ b/.github/workflows/release-image-api.yml @@ -64,7 +64,7 @@ jobs: context: "{{defaultContext}}:api" platforms: linux/arm64 push: true - tags: ${{ env.REGISTRY_HOST }}/kindlingx/apo-dify-api:${{ inputs.tag }}-arm64 + tags: ${{ env.REGISTRY_HOST }}/originx/apo-dify-api:${{ inputs.tag }} cache-from: type=gha,scope=dify-api-arm64 cache-to: type=gha,mode=max,scope=dify-api-arm64 diff --git a/.github/workflows/release-image-web.yml b/.github/workflows/release-image-web.yml index 06460bdc90aeb2..2817ef268681f7 100644 --- a/.github/workflows/release-image-web.yml +++ b/.github/workflows/release-image-web.yml @@ -63,7 +63,7 @@ jobs: context: "{{defaultContext}}:web" platforms: linux/arm64 push: true - tags: ${{ env.REGISTRY_HOST }}/kindlingx/apo-dify-web:${{ inputs.tag }}-arm64 + tags: ${{ env.REGISTRY_HOST }}/originx/apo-dify-web:${{ inputs.tag }} cache-from: type=gha,scope=dify-web-arm64 cache-to: type=gha,mode=max,scope=dify-web-arm64