-
Notifications
You must be signed in to change notification settings - Fork 204
add workflow dispatch to deploy the template #211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
12631ca
524ffc8
5bd183f
5f9554e
5ab2843
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: Build Prod Template | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| skip_cache: | ||
| description: Skip build cache | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
|
|
||
| concurrency: | ||
| group: Release-${{ github.ref }} | ||
| cancel-in-progress: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build-template: | ||
| name: Build E2B template | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: '3.13' | ||
|
|
||
| - name: Install development dependencies | ||
| working-directory: ./template | ||
| run: pip install -r requirements-dev.txt | ||
|
|
||
| - name: Build E2B template | ||
| id: build-template | ||
| working-directory: ./template | ||
| run: | | ||
| python build_prod.py | ||
| env: | ||
| E2B_API_KEY: ${{ secrets.E2B_PROD_API_KEY }} | ||
| E2B_DOMAIN: ${{ vars.E2B_DOMAIN }} | ||
matthewlouisbrockman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| SKIP_CACHE: ${{ inputs.skip_cache }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,18 @@ | ||
| import os | ||
|
|
||
| from dotenv import load_dotenv | ||
| from e2b import Template, default_build_logger | ||
| from template import make_template | ||
|
|
||
| load_dotenv() | ||
|
|
||
| skip_cache = os.getenv("SKIP_CACHE", "false").lower() == "true" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you just convert this to bool?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. preferring to check the value is actually true vs exists; otherwise it'll be any string, although I see the flip side that it's only set right now to "true". can change if really want it though. |
||
|
|
||
| Template.build( | ||
| make_template(), | ||
| alias="code-interpreter-v1", | ||
| cpu_count=2, | ||
| memory_mb=2048, | ||
| skip_cache=skip_cache, | ||
| on_build_logs=default_build_logger(), | ||
| ) | ||
Uh oh!
There was an error while loading. Please reload this page.