File tree Expand file tree Collapse file tree 5 files changed +27
-24
lines changed Expand file tree Collapse file tree 5 files changed +27
-24
lines changed Original file line number Diff line number Diff line change 1- # Workflow for fetching daily images and deploying to Cloudflare Pages
2- name : Fetch daily images and deploy to Cloudflare Pages
1+ # Workflow for fetching daily.json and deploying to Cloudflare Pages
2+ name : Fetch daily.json and deploy to Cloudflare Pages
33
44on :
55 # Runs daily at 02:30AM UTC (08:00AM IST)
@@ -29,27 +29,13 @@ jobs:
2929 - name : Checkout
3030 uses : actions/checkout@v4
3131
32- - name : Install Python dependencies
33- run : python -m pip install --upgrade instaloader
34- - name : Change directory to scripts
35- run : cd scripts
36-
37- - name : Fetch daily images
38- run : instaloader -F -c 5 --latest-stamps daily.stamps --dirname-pattern daily blr.on.this.day
39-
40- - name : Build daily.json
41- run : python daily.py
42-
43- - name : Upload daily images
44- run : aws s3 sync ./daily/ ${{ secrets.S3_DESTINATION_DIR }} --endpoint-url ${{ secrets.S3_ENDPOINT }}
45- env :
46- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
47- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
32+ - name : Fetch daily.json
33+ run : curl -L https://media.blryesterday.com/daily.json -o static/daily.json
4834
4935 - id : auto-commit-action
5036 uses : stefanzweifel/git-auto-commit-action@v5
5137 with :
52- commit_message : Update daily images
38+ commit_message : Update daily.json
5339
5440 deploy :
5541 needs : fetch
Original file line number Diff line number Diff line change @@ -22,3 +22,5 @@ vite.config.ts.timestamp-*
2222
2323# Other
2424scripts /daily
25+ scripts /daily.json
26+ scripts /daily.stamps
Original file line number Diff line number Diff line change 1111
1212# Path to the directory containing the files
1313DATA_DIR = Path (__file__ ).parent / "daily"
14- OUTPUT_FILE = Path (__file__ ).parent / ".." / "static" / " daily.json"
14+ OUTPUT_FILE = Path (__file__ ).parent / "daily.json"
1515
1616
1717def parse_filename (filename ):
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Source .env
4+ source .env
5+
6+ # Change directory to scripts
7+ cd scripts
8+
9+ # Fetch latest images
10+ ~ /.local/bin/instaloader -F -c 5 --latest-stamps daily.stamps --dirname-pattern daily blr.on.this.day
11+
12+ # Build daily JSON
13+ python3 daily.py
14+
15+ # Upload latest images
16+ aws s3 sync --include " *.jpg" ./daily/ " $S3_DESTINATION /daily/" --endpoint-url " $S3_ENDPOINT "
17+
18+ # Upload daily JSON
19+ aws s3 cp daily.json " $S3_DESTINATION /daily.json" --endpoint-url " $S3_ENDPOINT "
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments