forked from AeonOrg/Aeon-MLTB
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (72 loc) · 2.26 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Deploy to Heroku
on:
workflow_dispatch:
inputs:
HEROKU_APP_NAME:
description: "Heroku App name"
required: true
HEROKU_API_KEY:
description: "Heroku API key"
required: true
HEROKU_EMAIL:
description: "Heroku email address"
required: true
HEROKU_TEAM_NAME:
description: "Heroku Team Name"
required: false
BOT_TOKEN:
description: "Telegram bot token"
required: true
OWNER_ID:
description: "Owner's telegram ID"
required: true
DATABASE_URL:
description: "Database URL from MongoDB"
required: true
TELEGRAM_API:
description: "Telegram API ID from https://my.telegram.org/"
required: true
TELEGRAM_HASH:
description: "Telegram HASH from https://my.telegram.org/"
required: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout deploy branch
uses: actions/checkout@v2
- name: Delete unnecessary directories and files
run: |
# Directories to delete
for dir in bot qBittorrent web; do
if [ -d "./$dir" ]; then
echo "Deleting directory: $dir"
rm -rf ./$dir
else
echo "Directory not found: $dir"
fi
done
# Delete a2c.conf if it exists
if [ -f "./a2c.conf" ]; then
echo "Deleting file: a2c.conf"
rm -f ./a2c.conf
else
echo "File not found: a2c.conf"
fi
- name: Deploy to Heroku
uses: 5hojib/heroku-deploy-action@v2
with:
heroku_api_key: ${{inputs.HEROKU_API_KEY}}
heroku_app_name: ${{inputs.HEROKU_APP_NAME}}
heroku_email: ${{inputs.HEROKU_EMAIL}}
team: ${{ inputs.HEROKU_TEAM_NAME != '' && format('{0}', inputs.HEROKU_TEAM_NAME) || '' }}
usedocker: true
docker_heroku_process_type: web
stack: "container"
region: "eu"
env:
HD_OWNER_ID: ${{inputs.OWNER_ID}}
HD_TELEGRAM_API: ${{inputs.TELEGRAM_API}}
HD_TELEGRAM_HASH: ${{inputs.TELEGRAM_HASH}}
HD_DATABASE_URL: ${{inputs.DATABASE_URL}}
HD_BOT_TOKEN: ${{inputs.BOT_TOKEN}}