2022-04-10 15:28:51 +02:00
|
|
|
name: Fetch new content of tracked links and files
|
2021-04-24 14:19:01 +02:00
|
|
|
|
|
|
|
on:
|
2022-06-09 14:02:22 +02:00
|
|
|
workflow_dispatch:
|
2021-04-24 14:19:01 +02:00
|
|
|
schedule:
|
2022-05-13 12:49:33 +02:00
|
|
|
- cron: '* * * * *'
|
2021-04-24 14:19:01 +02:00
|
|
|
push:
|
2021-04-26 22:27:57 +02:00
|
|
|
# trigger on updated linkbase
|
2021-04-24 14:19:01 +02:00
|
|
|
branches:
|
2021-04-24 14:28:06 +02:00
|
|
|
- main
|
2021-04-24 14:19:01 +02:00
|
|
|
|
|
|
|
jobs:
|
2022-04-10 15:28:51 +02:00
|
|
|
fetch_new_content:
|
2021-04-24 14:19:01 +02:00
|
|
|
name: Make files tree
|
2022-06-09 13:24:04 +02:00
|
|
|
runs-on: ${{matrix.os}}
|
2022-05-13 11:57:11 +02:00
|
|
|
continue-on-error: true
|
2022-05-11 11:10:08 +02:00
|
|
|
timeout-minutes: 10
|
2021-04-24 14:19:01 +02:00
|
|
|
|
2022-05-13 11:57:11 +02:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-06-09 13:24:04 +02:00
|
|
|
include:
|
|
|
|
- mode: web
|
2022-07-28 01:13:22 +02:00
|
|
|
os: macos-12
|
2022-06-09 13:24:04 +02:00
|
|
|
|
|
|
|
- mode: web_res
|
|
|
|
os: ubuntu-20.04
|
|
|
|
|
2022-06-18 17:36:39 +02:00
|
|
|
- mode: web_tr
|
|
|
|
os: ubuntu-20.04
|
|
|
|
|
2022-06-09 13:24:04 +02:00
|
|
|
- mode: server
|
|
|
|
os: ubuntu-20.04
|
|
|
|
|
|
|
|
- mode: client
|
2022-07-28 01:13:22 +02:00
|
|
|
os: macos-12
|
2022-05-13 11:57:11 +02:00
|
|
|
|
2023-09-15 11:57:25 +02:00
|
|
|
- mode: mini_app
|
|
|
|
os: ubuntu-20.04
|
|
|
|
|
2021-04-24 14:19:01 +02:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Clone.
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
2021-04-25 18:00:32 +02:00
|
|
|
token: ${{ secrets.PAT }}
|
2021-04-24 14:19:01 +02:00
|
|
|
|
|
|
|
- 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/"
|
2022-04-24 13:33:16 +02:00
|
|
|
TELEGRAM_SESSION: ${{ secrets.TELEGRAM_SESSION }}
|
2022-05-10 20:32:58 +02:00
|
|
|
TELEGRAM_SESSION_TEST: ${{ secrets.TELEGRAM_SESSION_TEST }}
|
2022-04-24 13:33:16 +02:00
|
|
|
TELEGRAM_API_ID: ${{ secrets.TELEGRAM_API_ID }}
|
|
|
|
TELEGRAM_API_HASH: ${{ secrets.TELEGRAM_API_HASH }}
|
2022-05-13 11:57:11 +02:00
|
|
|
MODE: ${{ matrix.mode }}
|
2021-04-24 14:19:01 +02:00
|
|
|
run: |
|
2021-04-24 22:46:32 +02:00
|
|
|
git pull
|
2021-04-24 14:19:01 +02:00
|
|
|
python make_files_tree.py
|
2022-05-09 12:31:55 +02:00
|
|
|
rm -rf __pycache__
|
2021-04-24 14:19:01 +02:00
|
|
|
|
2022-05-13 12:42:48 +02:00
|
|
|
- name: Prepare data.
|
|
|
|
if: matrix.mode == 'web'
|
2021-04-24 14:19:01 +02:00
|
|
|
run: |
|
|
|
|
git checkout data
|
2022-05-13 12:42:48 +02:00
|
|
|
git pull
|
2021-04-24 14:19:01 +02:00
|
|
|
|
2022-05-13 11:57:11 +02:00
|
|
|
mv data/web_res data_ci/web_res
|
2022-06-18 17:36:39 +02:00
|
|
|
mv data/web_tr data_ci/web_tr
|
2022-05-13 12:42:48 +02:00
|
|
|
mv data/client data_ci/client
|
|
|
|
mv data/server data_ci/server
|
2023-09-15 11:57:25 +02:00
|
|
|
mv data/mini_app data_ci/mini_app
|
2022-05-13 12:42:48 +02:00
|
|
|
|
2021-04-24 14:19:01 +02:00
|
|
|
rm -rf data
|
|
|
|
mv data_ci data
|
|
|
|
|
2022-05-13 12:42:48 +02:00
|
|
|
- name: Prepare data.
|
|
|
|
if: matrix.mode == 'web_res'
|
2022-05-13 11:57:11 +02:00
|
|
|
run: |
|
|
|
|
git checkout data
|
2022-05-13 12:42:48 +02:00
|
|
|
git pull
|
2022-05-13 11:57:11 +02:00
|
|
|
|
|
|
|
mv data/web data_ci/web
|
2022-06-18 17:36:39 +02:00
|
|
|
mv data/web_tr data_ci/web_tr
|
2022-05-13 11:57:11 +02:00
|
|
|
mv data/client data_ci/client
|
|
|
|
mv data/server data_ci/server
|
2023-09-15 11:57:25 +02:00
|
|
|
mv data/mini_app data_ci/mini_app
|
2022-05-13 11:57:11 +02:00
|
|
|
|
|
|
|
rm -rf data
|
|
|
|
mv data_ci data
|
|
|
|
|
2022-06-18 17:36:39 +02:00
|
|
|
- name: Prepare data.
|
|
|
|
if: matrix.mode == 'web_tr'
|
|
|
|
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
|
|
|
|
mv data/client data_ci/client
|
2023-09-15 11:57:25 +02:00
|
|
|
mv data/mini_app data_ci/mini_app
|
2022-06-18 17:36:39 +02:00
|
|
|
|
|
|
|
rm -rf data
|
|
|
|
mv data_ci data
|
|
|
|
|
2022-05-13 12:42:48 +02:00
|
|
|
- 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
|
2022-06-18 17:36:39 +02:00
|
|
|
mv data/web_tr data_ci/web_tr
|
2022-05-13 12:42:48 +02:00
|
|
|
mv data/client data_ci/client
|
2023-09-15 11:57:25 +02:00
|
|
|
mv data/mini_app data_ci/mini_app
|
2022-05-13 12:42:48 +02:00
|
|
|
|
|
|
|
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
|
2022-06-18 17:36:39 +02:00
|
|
|
mv data/web_tr data_ci/web_tr
|
2022-05-13 12:42:48 +02:00
|
|
|
mv data/server data_ci/server
|
2023-09-15 11:57:25 +02:00
|
|
|
mv data/mini_app data_ci/mini_app
|
|
|
|
|
|
|
|
rm -rf data
|
|
|
|
mv data_ci data
|
|
|
|
|
|
|
|
- name: Prepare data.
|
|
|
|
if: matrix.mode == 'mini_app'
|
|
|
|
run: |
|
|
|
|
git checkout data
|
|
|
|
git pull
|
|
|
|
|
|
|
|
mv data/web data_ci/web
|
|
|
|
mv data/web_res data_ci/web_res
|
|
|
|
mv data/web_tr data_ci/web_tr
|
|
|
|
mv data/server data_ci/server
|
|
|
|
mv data/client data_ci/client
|
2022-05-13 12:42:48 +02:00
|
|
|
|
|
|
|
rm -rf data
|
|
|
|
mv data_ci data
|
|
|
|
|
2022-05-13 11:57:11 +02:00
|
|
|
- name: Commit and push changes.
|
|
|
|
run: |
|
2021-04-24 14:19:01 +02:00
|
|
|
git config --global user.email "github-action@users.noreply.github.com"
|
|
|
|
git config --global user.name "GitHub Action"
|
|
|
|
|
|
|
|
git add .
|
2021-04-24 14:38:39 +02:00
|
|
|
git commit -m "Update content of files"
|
2021-04-24 14:19:01 +02:00
|
|
|
git push
|