From 3fcdbdc74da01644397eae7fb77fb4b958589948 Mon Sep 17 00:00:00 2001 From: Romain Thomas Date: Tue, 10 Dec 2024 15:27:29 +0100 Subject: [PATCH] Nightly only --- .github/deploy.py | 40 +++++++++++----------------------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/.github/deploy.py b/.github/deploy.py index c872af8dcc..3f17c4ab7e 100644 --- a/.github/deploy.py +++ b/.github/deploy.py @@ -250,43 +250,25 @@ def is_main_branch(self, name: str) -> bool: return name in self._main_branches def should_be_deployed(self, branch: str) -> bool: - if GithubDeploy.is_tagged(): - return True - if any(re.match(s, branch) for s in self._branches): return True - if any(branch.startswith(e) for e in RELEASE_KEYWORD): - return True - return False 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: - logger.warning("Can't resolve the branch name") - sys.exit(1) - - for rel_kwrd in RELEASE_KEYWORD: - if branch.startswith(rel_kwrd): - _, s3dir = branch.split(rel_kwrd) - if s3dir is None: - - if self.is_main_branch(branch): - 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 + branch = GithubDeploy.branch() + + if branch is None: + logger.warning("Can't resolve the branch name") + sys.exit(1) + + s3dir = self._default_dir + + 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")