From 055fa3329508ff2a2766fafd0c2c78a282613981 Mon Sep 17 00:00:00 2001 From: Jakub Dobry Date: Sun, 22 Mar 2026 23:22:06 +0100 Subject: [PATCH 1/5] Add env selection to prod build workflow --- .github/workflows/build_prod_template.yml | 60 +++++++++++++++++++++-- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_prod_template.yml b/.github/workflows/build_prod_template.yml index ac2cfb33..84e1603c 100644 --- a/.github/workflows/build_prod_template.yml +++ b/.github/workflows/build_prod_template.yml @@ -3,6 +3,15 @@ name: Build Prod Template on: workflow_dispatch: inputs: + target_environment: + description: Target environment + required: true + type: choice + default: foxtrot + options: + - foxtrot + - staging + - juliett skip_cache: description: Skip build cache required: false @@ -33,18 +42,63 @@ jobs: - uses: actions/setup-python@v6 with: - python-version: '${{ env.TOOL_VERSION_PYTHON }}' + python-version: '${{ env.TOOL_VERSION_PYTHON }}' - name: Install development dependencies working-directory: ./template run: pip install -r requirements-dev.txt + - name: Resolve target environment + env: + TARGET_ENVIRONMENT: ${{ inputs.target_environment }} + FOXTROT_API_KEY: ${{ secrets.E2B_PROD_API_KEY }} + STAGING_API_KEY: ${{ secrets.E2B_STAGING_API_KEY }} + JULIETT_API_KEY: ${{ secrets.E2B_JULIETT_API_KEY }} + run: | + set -eu + + case "$TARGET_ENVIRONMENT" in + foxtrot) + E2B_DOMAIN="e2b.dev" + E2B_API_KEY="$FOXTROT_API_KEY" + ;; + staging) + E2B_DOMAIN="e2b-staging.dev" + E2B_API_KEY="$STAGING_API_KEY" + ;; + juliett) + E2B_DOMAIN="e2b-juliett.dev" + E2B_API_KEY="$JULIETT_API_KEY" + ;; + *) + echo "Unknown target environment: $TARGET_ENVIRONMENT" >&2 + exit 1 + ;; + esac + + if [ -z "$E2B_API_KEY" ]; then + echo "Missing API key secret for target environment: $TARGET_ENVIRONMENT" >&2 + exit 1 + fi + + echo "::add-mask::$E2B_API_KEY" + + { + echo "E2B_DOMAIN=$E2B_DOMAIN" + echo "E2B_API_KEY=$E2B_API_KEY" + } >> "$GITHUB_ENV" + + { + echo "### Build target" + echo + echo "Target: $TARGET_ENVIRONMENT" + echo "Domain: $E2B_DOMAIN" + } >> "$GITHUB_STEP_SUMMARY" + - 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 }} SKIP_CACHE: ${{ inputs.skip_cache }} From 7564d96b5dcbe905fd3da9547d06828ca96f57be Mon Sep 17 00:00:00 2001 From: Jakub Dobry Date: Sun, 22 Mar 2026 23:27:23 +0100 Subject: [PATCH 2/5] Scope prod build concurrency by target env --- .github/workflows/build_prod_template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_prod_template.yml b/.github/workflows/build_prod_template.yml index 84e1603c..3dbfcfe8 100644 --- a/.github/workflows/build_prod_template.yml +++ b/.github/workflows/build_prod_template.yml @@ -19,7 +19,7 @@ on: default: false concurrency: - group: Release-${{ github.ref }} + group: Release-${{ github.ref }}-${{ inputs.target_environment }} cancel-in-progress: false permissions: From 672aba423b165152814771f3111cb10636017a2e Mon Sep 17 00:00:00 2001 From: Jakub Dobry Date: Sun, 22 Mar 2026 23:28:18 +0100 Subject: [PATCH 3/5] Use configured foxtrot domain in prod build --- .github/workflows/build_prod_template.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_prod_template.yml b/.github/workflows/build_prod_template.yml index 3dbfcfe8..59ab9d14 100644 --- a/.github/workflows/build_prod_template.yml +++ b/.github/workflows/build_prod_template.yml @@ -51,6 +51,7 @@ jobs: - name: Resolve target environment env: TARGET_ENVIRONMENT: ${{ inputs.target_environment }} + FOXTROT_DOMAIN: ${{ vars.E2B_DOMAIN }} FOXTROT_API_KEY: ${{ secrets.E2B_PROD_API_KEY }} STAGING_API_KEY: ${{ secrets.E2B_STAGING_API_KEY }} JULIETT_API_KEY: ${{ secrets.E2B_JULIETT_API_KEY }} @@ -59,7 +60,7 @@ jobs: case "$TARGET_ENVIRONMENT" in foxtrot) - E2B_DOMAIN="e2b.dev" + E2B_DOMAIN="$FOXTROT_DOMAIN" E2B_API_KEY="$FOXTROT_API_KEY" ;; staging) From 33d33142e1491725b9dc813abb326cb58029e6d2 Mon Sep 17 00:00:00 2001 From: Matt Brockman Date: Sun, 22 Mar 2026 15:59:24 -0700 Subject: [PATCH 4/5] valdiate foxtrot E2B domain in prod build workflow --- .github/workflows/build_prod_template.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build_prod_template.yml b/.github/workflows/build_prod_template.yml index 59ab9d14..da3424b0 100644 --- a/.github/workflows/build_prod_template.yml +++ b/.github/workflows/build_prod_template.yml @@ -77,6 +77,11 @@ jobs: ;; esac + if [ -z "$E2B_DOMAIN" ]; then + echo "Missing E2B domain for target environment: $TARGET_ENVIRONMENT" >&2 + exit 1 + fi + if [ -z "$E2B_API_KEY" ]; then echo "Missing API key secret for target environment: $TARGET_ENVIRONMENT" >&2 exit 1 From 3ec2d6558129ac7ec8d57f4834a03cd23550419f Mon Sep 17 00:00:00 2001 From: Jakub Dobry Date: Mon, 23 Mar 2026 12:08:34 +0100 Subject: [PATCH 5/5] Align release lock with foxtrot builds --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8c66f04d..4991041f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: branches: - main -concurrency: ${{ github.workflow }}-${{ github.ref }} +concurrency: Release-${{ github.ref }}-foxtrot permissions: id-token: write