Skip to content

Prefer downloading .json.lz4 #628

Prefer downloading .json.lz4

Prefer downloading .json.lz4 #628

Workflow file for this run

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'