forked from MarshalX/telegram-crawler
-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (115 loc) · 3.32 KB
/
make_files_tree.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Fetch new content of tracked links and files
on:
workflow_dispatch:
schedule:
- cron: '* * * * *'
push:
# trigger on updated linkbase
branches:
- main
jobs:
fetch_new_content:
name: Make files tree
runs-on: ${{matrix.os}}
continue-on-error: true
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- mode: web
os: macos-10.15
- mode: web_res
os: ubuntu-20.04
- mode: web_tr
os: ubuntu-20.04
- mode: server
os: ubuntu-20.04
- mode: client
os: macos-10.15
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/web_tr data_ci/web_tr
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/web_tr data_ci/web_tr
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_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
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/web_tr data_ci/web_tr
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/web_tr data_ci/web_tr
mv data/server data_ci/server
rm -rf data
mv data_ci data
- name: Commit and push changes.
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git add .
git commit -m "Update content of files"
git push