-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.48 KB
/
Copy pathrefresh-data.yml
File metadata and controls
50 lines (42 loc) · 1.48 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
name: Refresh MCU data
# Pulls fresh data from TMDB (posters, ratings, runtimes, release dates,
# IMDb ids, synopses) into mcu-data.json once a day. If anything changed,
# it commits the update. NOTE: this repo has no Vercel git integration, so
# the commit alone does NOT deploy — pull it locally and run `vercel --prod`
# to actually ship the refreshed data.
# Needs a repo secret: TMDB_API_KEY
on:
schedule:
- cron: "17 6 * * *" # daily at 06:17 UTC
workflow_dispatch: # allow manual runs from the Actions tab
permissions:
contents: write
concurrency:
group: refresh-data
cancel-in-progress: false
jobs:
refresh:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Refresh data from TMDB
env:
TMDB_API_KEY: ${{ secrets.TMDB_API_KEY }}
run: node refresh-data.mjs
- name: Commit if data changed
run: |
if [[ -n "$(git status --porcelain mcu-data.json)" ]]; then
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add mcu-data.json
git commit -m "chore: refresh TMDB data ($(date -u +%Y-%m-%d))"
git push
echo "✅ mcu-data.json updated."
else
echo "No changes — data already up to date."
fi