add discord-bot

This commit is contained in:
Simon 2023-08-01 10:28:07 +07:00
parent c50a1a91d2
commit 2e95a5b912
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
5 changed files with 18 additions and 1 deletions

1
.gitignore vendored
View File

@ -8,6 +8,7 @@ tubearchivist.env
umami.env
gitea.env
redditbot.env
discord-bot.env
# example hooks
docker-hook.json

View File

@ -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

1
env/discord-bot.sample.env vendored Normal file
View File

@ -0,0 +1 @@
BOT_TOKEN=xxxxxxxxxx

View File

@ -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")

View File

@ -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