-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (36 loc) · 1.22 KB
/
update-subscriptions.yml
File metadata and controls
43 lines (36 loc) · 1.22 KB
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
name: update
on:
schedule:
- cron: '0 */3 * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.MY_PAT }}
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: pip install aiohttp
- name: Запуск парсера
working-directory: ./source
run: |
python parser.py
# Копируем файлы в корневую папку deploy
mkdir -p ../deploy/subscriptions
cp -r deploy/* ../deploy/ 2>/dev/null || true
- name: Коммит и пуш
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
git add -f deploy/
if git diff --staged --quiet; then
echo "Нет изменений для коммита"
else
git commit -m "🔄 Автообновление $(date +'%Y-%m-%d %H:%M')"
git pull --rebase origin main
git push origin main
fi