Prefer downloading .json.lz4
#628
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "daily-update" | |
on: | |
schedule: | |
- cron: "15 5 * * *" | |
push: | |
paths: | |
- ".github/**" | |
jobs: | |
daily-update: | |
runs-on: "ubuntu-latest" | |
environment: "anidb" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
- name: "Setup Python" | |
uses: "actions/setup-python@v5" | |
with: | |
python-version: "3.x" | |
cache: "pip" | |
- name: "Setup dependencies" | |
run: | | |
pip install -r requirements.txt | |
- name: "Download `animetitles.json.lz4`" | |
run: | | |
mkdir -p 'data' | |
# Feel free to use this URL directly, but I don't guarantee any kind | |
# of availability. | |
# | |
# Also, this file only changes once a day, so don't go crazy with the | |
# requests. | |
# | |
# Ensure your HTTP client respects `ETag` or `Cache-Control` headers. | |
( | |
curl \ | |
--verbose \ | |
--fail --fail-early \ | |
'https://ddl.c032.dev/anidb/animetitles.json.lz4' | |
) > 'data/animetitles.json.lz4' | |
- name: "Decompress `animetitles.json.lz4`" | |
run: | | |
lz4 -d --rm 'data/animetitles.json.lz4' | |
- name: "Sanity check" | |
run: | | |
python check.py | |
- name: "`git config`" | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "<>" | |
- name: 'Commit and push' | |
run: | | |
git add --all -v 'data" | |
git commit -m 'Daily update' | |
git push 'origin' 'main' |