-
-
Notifications
You must be signed in to change notification settings - Fork 200
39 lines (32 loc) · 1.03 KB
/
generate-books-json.yml
File metadata and controls
39 lines (32 loc) · 1.03 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
name: Generate books.json
on:
schedule:
- cron: "0 6 2 * *" # 2nd of each month, 6AM UTC (one day after the text-export CronJob on the 1st)
workflow_dispatch: {} # Allow manual trigger
permissions:
contents: write
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: pip install requests
- name: Generate books.json from GCS bucket listing
env:
BUCKET: sefaria-export
run: python scripts/generate_books_json.py
- name: Commit and push if changed
run: |
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add books.json
if git diff --cached --quiet; then
echo "No changes to books.json"
else
git commit -m "Update books.json $(date +%Y-%m-%d)"
git push
fi