-
Notifications
You must be signed in to change notification settings - Fork 211
64 lines (55 loc) · 1.74 KB
/
build_template.yml
File metadata and controls
64 lines (55 loc) · 1.74 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
56
57
58
59
60
61
62
63
64
name: Build Template
on:
workflow_call:
secrets:
E2B_API_KEY:
required: true
E2B_DOMAIN:
required: false
E2B_TEMPLATE_CONFIG:
required: false
permissions:
contents: read
jobs:
build-docker-image:
name: Build Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- 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: Build Docker image
uses: docker/build-push-action@v6
with:
context: ./template
push: false
platforms: linux/amd64
tags: ${{ secrets.DOCKERHUB_USERNAME }}/code-interpreter:latest
build-template:
name: Build E2B template
runs-on: ubuntu-latest
needs: [build-docker-image]
if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install E2B CLI
run: npm install -g @e2b/cli
- name: Build E2B template
run: e2b template build --config ${{ secrets.E2B_TEMPLATE_CONFIG }}
working-directory: ./template
env:
E2B_ACCESS_TOKEN: ${{ secrets.E2B_ACCESS_TOKEN }}
E2B_DOMAIN: ${{ secrets.E2B_DOMAIN }}
E2B_TEMPLATE_CONFIG: ${{ secrets.E2B_TEMPLATE_CONFIG }}