trigger website rebuild on build hook

This commit is contained in:
Simon 2023-07-31 21:41:53 +07:00
parent 1a464b4397
commit 1498b5712f
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
2 changed files with 16 additions and 0 deletions

View File

@ -45,6 +45,14 @@ class WebhookBase:
"rebuild": [ "rebuild": [
["docker", "compose", "-f", "../docker/docker-compose.yml", "up", "-d", "--build", "docs"] ["docker", "compose", "-f", "../docker/docker-compose.yml", "up", "-d", "--build", "docs"]
] ]
},
"website": {
"gh_user": "tubearchivist",
"gh_repo": "docs",
"unstable_keyword": "#build",
"rebuild": [
["docker", "compose", "-f", "../docker/docker-compose.yml", "up", "-d", "--build", "tubearchivist"]
]
} }
} }
ROADMAP_HOOK_URL = environ.get("ROADMAP_HOOK_URL") ROADMAP_HOOK_URL = environ.get("ROADMAP_HOOK_URL")

View File

@ -79,6 +79,14 @@ class GithubHook(WebhookBase):
TaskHandler(self.repo_conf).create_task("rebuild") TaskHandler(self.repo_conf).create_task("rebuild")
return return
if self.repo == "website":
to_rebuild = self.check_commit_message()
if to_rebuild:
TaskHandler(self.repo_conf).create_task("rebuild")
else:
print("build keyword not found in commit message")
return
self._check_readme() self._check_readme()
build_message = self.check_commit_message() build_message = self.check_commit_message()