Update cache and publish site #1481
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/github-pages-deploy-action@4.0.0 | |
with: | |
branch: gh-pages | |
folder: public |