-
Notifications
You must be signed in to change notification settings - Fork 209
Add target env selection to prod build workflow #228
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 1 commit
055fa33
7564d96
672aba4
33d3314
3ec2d65
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 |
|---|---|---|
|
|
@@ -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" | ||
|
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.
This hardcodes the foxtrot target to Useful? React with 👍 / 👎. |
||
| 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 | ||
|
cursor[bot] marked this conversation as resolved.
|
||
|
|
||
| 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 }} | ||
Uh oh!
There was an error while loading. Please reload this page.