-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 2.04 KB
/
Copy pathupdate.yml
File metadata and controls
61 lines (51 loc) · 2.04 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
name: Update model data
on:
schedule:
- cron: '0 4 * * *' # Runs every 24 hours
workflow_dispatch: # Allow manual trigger
jobs:
update-releases:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v6
with:
ref: data
- name: Fetch repository details
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -s -H "Authorization: Bearer $GH_TOKEN" \
"https://api.github.com/repos/redasm-dev/redasm" > repository.json
- name: Fetch releases
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -s -H "Authorization: Bearer $GH_TOKEN" \
"https://api.github.com/repos/redasm-dev/redasm/releases" > releases.json
- name: Fetch CI status
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -s -H "Authorization: Bearer $GH_TOKEN" \
"https://api.github.com/repos/redasm-dev/workspace/actions/workflows/ci.yml/runs?per_page=10" > ci.json
curl -s -H "Authorization: Bearer $GH_TOKEN" \
"https://api.github.com/repos/redasm-dev/workspace/actions/workflows/nightly.yml/runs?per_page=10" > nightly.json
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: '3.12'
- name: Install dependencies
run: pip install matplotlib
- name: Update download stats
run: python3 scripts/append_downloads.py
- name: Generate charts and README
run: python3 scripts/generate_charts.py --csv downloads.csv --out-dir charts
- name: Push updates to data branch
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add repository.json releases.json ci.json nightly.json \
downloads.csv charts/ README.md
git commit -m "chore: update model" || echo "No changes to commit"
git push -f origin data