Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

feat(ci): sync E2B template on release tag push (#40858)

Bond Zhuf6a472d948ca
diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml
index 61d654bd375..dd570b9f4ef 100644
--- a/.github/workflows/build-push.yml
+++ b/.github/workflows/build-push.yml
@@ -229,3 +229,32 @@ jobs:
IMAGE_VERSION: ${{ steps.meta.outputs.version }}
run: |
docker buildx imagetools inspect "$IMAGE_NAME:$IMAGE_VERSION"
+
+ sync-e2b-template:
+ needs: create-manifest
+ runs-on: ubuntu-24.04
+ if: github.repository == 'langgenius/dify' && startsWith(github.ref, 'refs/tags/')
+ strategy:
+ matrix:
+ include:
+ - project: dev
+ api_key_secret: E2B_API_KEY_DEV
+ - project: prod
+ api_key_secret: E2B_API_KEY_PROD
+ steps:
+ - name: Checkout
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
+
+ - name: Login to Docker Hub
+ uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
+ with:
+ username: ${{ env.DOCKERHUB_USER }}
+ password: ${{ env.DOCKERHUB_TOKEN }}
+
+ - name: Sync E2B Template (${{ matrix.project }})
+ env:
+ E2B_API_KEY: ${{ secrets[matrix.api_key_secret] }}
+ run: ./dify-agent-runtime/docker/sync-e2b-template.sh
diff --git a/dify-agent-runtime/Makefile b/dify-agent-runtime/Makefile
index 76e853a03f9..533248f5e1d 100644
--- a/dify-agent-runtime/Makefile
+++ b/dify-agent-runtime/Makefile
@@ -1,4 +1,4 @@
-.PHONY: build clean test lint gen-cli-help integration integration-up integration-test integration-down
+.PHONY: build clean test lint gen-cli-help integration integration-up integration-test integration-down sync-e2b-template-dev sync-e2b-template-prod sync-e2b-template-dry-run
BIN_DIR := bin
AGENT_CLI_HELP_JSON := ../dify-agent/src/dify_agent/layers/_agent_cli_help.json
@@ -128,3 +128,18 @@ integration:
@$(MAKE) integration-up
@trap '$(MAKE) integration-down' EXIT; \
$(MAKE) integration-test
+
+# --- E2B Template sync ---
+#
+# Both E2B projects publish the same template name (dify-agent-local-sandbox);
+# the project itself is the isolation boundary. Export E2B_API_KEY_DEV /
+# E2B_API_KEY_PROD in your shell before running the non-dry-run targets.
+
+sync-e2b-template-dry-run:
+ ./docker/sync-e2b-template.sh --dry-run
+
+sync-e2b-template-dev:
+ E2B_API_KEY=$(E2B_API_KEY_DEV) ./docker/sync-e2b-template.sh
+
+sync-e2b-template-prod:
+ E2B_API_KEY=$(E2B_API_KEY_PROD) ./docker/sync-e2b-template.sh