-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction_workflow_example.yml
41 lines (33 loc) · 1.17 KB
/
action_workflow_example.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
# Github Action workflow that gets last updates from telegram channel with python-telegram-bot and commits them to your repository with PyGithub
name: backup workflow
on:
schedule:
- cron: '30 23 * * *'
permissions: write-all
# replace with your names
env:
CHANNEL_REPO: your repository name
BRANCH: branch name
jobs:
import:
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
run: |
pip install python-telegram-bot --upgrade
pip install PyGithub
pip install 'telegraph[aio]'
pip install beautifulsoup4
- name: Checkout telegram_channel_backup repo
uses: actions/checkout@v4
with:
repository: CatUnderTheLeaf/telegram_channel_backup
path: telegram_channel_backup
- name: Run backup
env:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
run: python telegram_channel_backup/backup_telegram_channel.py bot_token="$BOT_TOKEN"
- name: Run upload
env:
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
run: python telegram_channel_backup/upload_to_github.py auth_token="$AUTH_TOKEN" repo=$CHANNEL_REPO branch=$BRANCH