Skip to content

Commit

Permalink
update the default deployment in CI, check env in deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesfrye committed Dec 4, 2024
1 parent aed1974 commit a06236e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
env:
MODAL_TOKEN_ID: ${{ secrets.MODAL_MODAL_LABS_TOKEN_ID }}
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_MODAL_LABS_TOKEN_SECRET }}
MODAL_ENVIRONMENT: main
MODAL_ENVIRONMENT: examples

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 4 additions & 0 deletions internal/deploy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import argparse
import os
import re
import shlex
import subprocess
Expand All @@ -20,6 +21,7 @@ def deploy(
module_with_app: Path,
dry_run: bool,
filter_pttrn: Optional[str],
env: Optional[dict[str, str]],
) -> Optional[DeployError]:
if filter_pttrn and not re.match(filter_pttrn, module_with_app.name):
return None
Expand All @@ -37,6 +39,7 @@ def deploy(
shlex.split(deploy_command),
cwd=module_with_app.parent,
capture_output=True,
env=(env or {}) | os.environ,
)
if r.returncode != 0:
print(
Expand Down Expand Up @@ -88,6 +91,7 @@ def main(argv: Optional[list[str]] = None) -> int:
module_with_app=Path(ex_mod.module),
dry_run=arguments.dry_run,
filter_pttrn=filter_pttrn,
env=ex_mod.metadata.get("env"),
)
for ex_mod in example_modules
]
Expand Down

0 comments on commit a06236e

Please sign in to comment.