telegram-crawler/.github/workflows/make_files_tree.yml
2022-05-13 12:49:33 +02:00

116 lines
2.6 KiB
YAML

name: Fetch new content of tracked links and files
on:
schedule:
- cron: '* * * * *'
push:
# trigger on updated linkbase
branches:
- main
jobs:
fetch_new_content:
name: Make files tree
runs-on: macos-10.15
continue-on-error: true
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
mode: [
"web",
"web_res",
"server",
"client"
]
steps:
- name: Clone.
uses: actions/checkout@v2
with:
token: ${{ secrets.PAT }}
- name: Setup Python.
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies.
run: |
pip install -r requirements.txt
- name: Generate files tree.
env:
OUTPUT_FOLDER: "data_ci/"
TELEGRAM_SESSION: ${{ secrets.TELEGRAM_SESSION }}
TELEGRAM_SESSION_TEST: ${{ secrets.TELEGRAM_SESSION_TEST }}
TELEGRAM_API_ID: ${{ secrets.TELEGRAM_API_ID }}
TELEGRAM_API_HASH: ${{ secrets.TELEGRAM_API_HASH }}
MODE: ${{ matrix.mode }}
run: |
git pull
python make_files_tree.py
rm -rf __pycache__
- name: Prepare data.
if: matrix.mode == 'web'
run: |
git checkout data
git pull
mv data/web_res data_ci/web_res
mv data/client data_ci/client
mv data/server data_ci/server
rm -rf data
mv data_ci data
- name: Prepare data.
if: matrix.mode == 'web_res'
run: |
git checkout data
git pull
mv data/web data_ci/web
mv data/client data_ci/client
mv data/server data_ci/server
rm -rf data
mv data_ci data
- name: Prepare data.
if: matrix.mode == 'server'
run: |
git checkout data
git pull
mv data/web data_ci/web
mv data/web_res data_ci/web_res
mv data/client data_ci/client
rm -rf data
mv data_ci data
- name: Prepare data.
if: matrix.mode == 'client'
run: |
git checkout data
git pull
mv data/web data_ci/web
mv data/web_res data_ci/web_res
mv data/server data_ci/server
rm -rf data
mv data_ci data
- name: Commit and push changes.
run: |
git config --global user.email "github-action@users.noreply.github.com"
git config --global user.name "GitHub Action"
git add .
git commit -m "Update content of files"
git push