diff --git a/.gitignore b/.gitignore index 78a4a90..6b2e790 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ tubearchivist.env umami.env gitea.env redditbot.env +discord-bot.env # example hooks docker-hook.json diff --git a/docker-compose_production.yml b/docker-compose_production.yml index 5123409..c9b824b 100644 --- a/docker-compose_production.yml +++ b/docker-compose_production.yml @@ -72,6 +72,14 @@ services: - LETSENCRYPT_HOST=docs.tubearchivist.com networks: - tubearchivist_network + discord-bot: + container_name: discord-bot + build: https://github.com/tubearchivist/discord-bot.git + restart: always + env_file: + - ./env/discord-bot.env + networks: + - tubearchivist_network # backend postgres postgres: image: postgres:15 diff --git a/env/discord-bot.sample.env b/env/discord-bot.sample.env new file mode 100644 index 0000000..1940bb3 --- /dev/null +++ b/env/discord-bot.sample.env @@ -0,0 +1 @@ +BOT_TOKEN=xxxxxxxxxx \ No newline at end of file diff --git a/tubearchivist/web/src/webhook_base.py b/tubearchivist/web/src/webhook_base.py index c89f8be..2f442f9 100644 --- a/tubearchivist/web/src/webhook_base.py +++ b/tubearchivist/web/src/webhook_base.py @@ -58,6 +58,13 @@ class WebhookBase: ], "discord_release_hook": environ.get("GITHUB_RELEASE_HOOK_URL"), }, + "discord-bot": { + "gh_user": "tubearchivist", + "gh_repo": "discord-bot", + "rebuild": [ + ["docker", "compose", "-f", "../docker/docker-compose.yml", "up", "-d", "--build", "discord-bot"] + ], + }, } ROADMAP_HOOK_URL = environ.get("ROADMAP_HOOK_URL") GH_HOOK_SECRET = environ.get("GH_HOOK_SECRET") diff --git a/tubearchivist/web/src/webhook_github.py b/tubearchivist/web/src/webhook_github.py index df1f2fd..5bae6be 100644 --- a/tubearchivist/web/src/webhook_github.py +++ b/tubearchivist/web/src/webhook_github.py @@ -75,7 +75,7 @@ class GithubHook(WebhookBase): print("commit not on master") return - if self.repo == "docs": + if self.repo in ["docs", "discord-bot"]: TaskHandler(self.repo_conf).create_task("rebuild") return