-
Notifications
You must be signed in to change notification settings - Fork 209
55 lines (48 loc) · 1.59 KB
/
build_test_template.yml
File metadata and controls
55 lines (48 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Build Template
on:
workflow_call:
secrets:
E2B_TESTS_ACCESS_TOKEN:
required: true
inputs:
E2B_DOMAIN:
required: false
type: string
outputs:
template_id:
description: "The ID of the built template"
value: ${{ jobs.build.outputs.template_id }}
permissions:
contents: read
jobs:
build:
name: Build E2B Template
runs-on: ubuntu-latest
outputs:
template_id: ${{ steps.build-template.outputs.template_id }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set package version
working-directory: ./template
run: |
VERSION=$(cat ../chart_data_extractor/pyproject.toml | grep version | cut -d '"' -f 2)
echo "Version: $VERSION"
sed -i "s/e2b_charts/e2b_charts==${VERSION}/g" requirements.txt
- name: Install E2B CLI
run: npm install -g @e2b/cli
- name: Build E2B template
id: build-template
run: |
rm -f e2b.toml
e2b template build --memory-mb 1024 -c "/root/.jupyter/start-up.sh" -d "Dockerfile"
TEMPLATE_ID=$(grep "template_id" e2b.toml | cut -d '"' -f 2)
echo "Captured Template ID: $TEMPLATE_ID"
echo "template_id=$TEMPLATE_ID" >> $GITHUB_OUTPUT
working-directory: ./template
env:
E2B_ACCESS_TOKEN: ${{ secrets.E2B_TESTS_ACCESS_TOKEN }}
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}
- name: Output template ID
run: |
echo "Template ID from step output: ${{ steps.build-template.outputs.template_id }}"