-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (57 loc) · 1.91 KB
/
Copy pathsync.yml
File metadata and controls
68 lines (57 loc) · 1.91 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
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
name: Sync latest data
on:
schedule:
- cron: '0 */1 * * *'
workflow_dispatch:
jobs:
update-data:
runs-on: ubuntu-latest
timeout-minutes: 50
permissions:
contents: write
env:
HF_HOME: ${{ github.workspace }}/.cache/huggingface
TRANSFORMERS_OFFLINE: "0"
HF_HUB_OFFLINE: "0"
OMP_NUM_THREADS: "4"
MKL_NUM_THREADS: "4"
TOKENIZERS_PARALLELISM: "false"
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Set up uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Cache HuggingFace models
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.cache/huggingface
key: hf-models-${{ runner.os }}-${{ hashFiles('pyproject.toml', 'core/ai/models.py', 'core/ai/taxonomy.py') }}
restore-keys: |
hf-models-${{ runner.os }}-
hf-models-
- name: Install dependencies
run: uv sync
- name: Warm AI models
run: uv run python -m core.ai.models
continue-on-error: true
- name: Sync and update data
run: uv run python main.py
env:
API_ID: ${{ secrets.API_ID }}
API_HASH: ${{ secrets.API_HASH }}
API_SESSION: ${{ secrets.API_SESSION }}
PHONE: ${{ secrets.PHONE }}
CHANNEL_USERNAME: ${{ secrets.CHANNEL_USERNAME }}
- name: Commit and Push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add telegram_messages.db app/public/data/*.json
git diff --quiet && git diff --staged --quiet || \
(git commit -m "Automated data sync: $(date -u)" && git push)