-
-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (47 loc) · 1.46 KB
/
update-and-publish.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
name: Update cache and publish site
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
concurrency: telegram_checks
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Validate data
run: python main.py validate
- name: Update telegram cache
run: python main.py update_telegram
env:
API_ID: ${{ secrets.API_ID }}
API_HASH: ${{ secrets.API_HASH }}
SESSION_STRING: ${{ secrets.SESSION_STRING }}
- name: Update twitter cache
run: python main.py update_twitter
env:
API_KEY: ${{ secrets.TWITTER_API_KEY }}
API_KEY_SECRET: ${{ secrets.TWITTER_API_KEY_SECRET }}
ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
- name: Save cache
uses: EndBug/add-and-commit@v7
with:
add: '["cache/telegram_data_cache.json", "cache/twitter_data_cache.json"]'
message: "Updating telegram and twitter cache"
- name: Create index.html
run: python main.py create_html
- uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: public