Skip to content

Commit 58c3520

Browse files
committed
dynamic template id for each build
1 parent 4442288 commit 58c3520

File tree

3 files changed

+11
-21
lines changed

3 files changed

+11
-21
lines changed

.github/workflows/build_template.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,16 @@ jobs:
5050
run: npm install -g @e2b/cli
5151

5252
- name: Build E2B template
53-
run: e2b template build --config ${{ inputs.E2B_TEMPLATE_CONFIG }}
53+
id: build-template
54+
run: |
55+
OUTPUT=$(e2b template build --team "460355b3-4f64-48f9-9a16-4442817f79f5" --memory-mb 1024 -c "/root/.jupyter/start-up.sh" -d "e2b.Dockerfile")
56+
echo "build_output=$OUTPUT" >> $GITHUB_OUTPUT
57+
TEMPLATE_ID=$(echo "$OUTPUT" | grep -o '✅ Building sandbox template [a-z0-9]*' | cut -d' ' -f5)
58+
echo "template_id=$TEMPLATE_ID" >> $GITHUB_OUTPUT
5459
working-directory: ./template
5560
env:
5661
E2B_ACCESS_TOKEN: ${{ secrets.E2B_ACCESS_TOKEN }}
5762
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}
63+
64+
- name: Output template ID
65+
run: echo "Template ID: ${{ steps.build-template.outputs.template_id }}"

.github/workflows/pull_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
3232
with:
3333
E2B_DOMAIN: ${{ vars.E2B_DOMAIN }}
34-
E2B_CI_TEMPLATE: ${{ vars.E2B_CI_TEMPLATE }}
34+
E2B_CI_TEMPLATE: ${{ needs.build-template.outputs.template_id }}
3535
python-sdk:
3636
uses: ./.github/workflows/python_tests.yml
3737
needs: build-template
@@ -40,6 +40,6 @@ jobs:
4040
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
4141
with:
4242
E2B_DOMAIN: ${{ vars.E2B_DOMAIN }}
43-
E2B_CI_TEMPLATE: ${{ vars.E2B_CI_TEMPLATE }}
43+
E2B_CI_TEMPLATE: ${{ needs.build-template.outputs.template_id }}
4444
charts-tests:
4545
uses: ./.github/workflows/charts_tests.yml

template/e2b.test.toml

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)