Skip to content

Commit

Permalink
Fix script
Browse files Browse the repository at this point in the history
  • Loading branch information
romainthomas committed Jan 20, 2024
1 parent 58f499a commit 16962f2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,11 @@ def should_be_deployed(self, branch: str) -> bool:

def deploy(self, directories: list[str]):
s3dir = None
tag = None
if GithubDeploy.is_tagged():
s3dir = GithubDeploy.tag_name()
tag = s3dir if len(s3dir) > 0 else None
logger.info("Deployment for tag: %s", tag)
else:
branch = GithubDeploy.branch()
if branch is None:
Expand All @@ -275,14 +278,15 @@ def deploy(self, directories: list[str]):
s3dir = self._default_dir
else:
s3dir = branch.replace("/", "-").replace("_", "-")

if not self.should_be_deployed(branch):
logger.info("Skipping deployment for branch: %s", branch)
return

if s3dir is None:
logger.error("Target directory is not set")
sys.exit(1)

if not self.should_be_deployed(branch):
logger.info("Skipping deployment for branch: %s", branch)
return

logger.info("s3dir: %s", s3dir)
self.s3_manager.change_dir(s3dir)
for dirname in directories:
Expand Down

0 comments on commit 16962f2

Please sign in to comment.