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

This commit is contained in:
Bond Zhu
2026-08-17 06:06:46 +00:00
committed by GitHub
parent 45be4620fe
commit f6a472d948
2 changed files with 45 additions and 1 deletions
+29
View File
@@ -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
+16 -1
View File
@@ -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