Add Heroku support (#1)

* Create Procfile

* Create config.py

* Create runtime.txt

* Create app.json

* Add "Deploy to Heroku" button to README.md

Co-authored-by: Dash Eclipse <dashezup@disroot.org>
This commit is contained in:
Shrimadhav U K
2021-04-20 22:54:09 +05:30
committed by Dash Eclipse
parent d3dc14977b
commit bdfc0135eb
5 changed files with 28 additions and 1 deletions
+1
View File
@@ -0,0 +1 @@
web: python main.py
+4
View File
@@ -15,6 +15,10 @@ conflicts.
3. Format and send the text to a Telegram chat through "sendMessage" method of
Telegram Bot API (`GET` request)
### Heroku
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/dashezup/github-webhook-to-telegram)
### Setup
You need a Telegram bot token, create a Telegram bot with
+20
View File
@@ -0,0 +1,20 @@
{
"name": "GitHub Webhook to Telegram",
"description": "Receive GitHub webhook events and send to Telegram chats with AIOHTTP through Telegram Bot API",
"repository": "https://github.com/dashezup/github-webhook-to-telegram",
"keywords": [
"github",
"webhooks",
"telegram",
"aiohttp",
"python",
"telegram-bot",
"telegram-bot-api"
],
"env": {
"HOOK_CONFIG": {
"description": "configuration in JSON format, check README and config_sample.json",
"required": true
}
}
}
+2 -1
View File
@@ -3,10 +3,11 @@ from os import environ
if environ.get('DYNO'):
data = json.loads(environ.get("HOOK_CONFIG"))
PORT = int(environ.get('PORT'))
else:
with open("config.json") as f:
data = json.load(f)
PORT = data.get('port')
BOT_TOKEN = data['bot_token']
PORT = data.get('port')
GH_WEBHOOKS = data['gh_webhooks']
+1
View File
@@ -0,0 +1 @@
python-3.9.4