plugo/.github/workflows/update-data.yml

33 lines
1.2 KiB
YAML
Raw Normal View History

2022-03-05 15:50:21 +00:00
name: Update Data
on:
schedule:
# “At minute 7 past hour 4, 7, 10, 13, and 16.”
2022-03-14 07:20:11 +00:00
# 4:00, 7:00, 10:00, 13:00, 16:00 UTC
# 9:30, 12:30, 15:30, 18:30, 21:30 IST
2022-03-05 15:50:21 +00:00
# https://crontab.guru/#7_4,7,10,13,16_*_*_*
- cron: '7 4,7,10,13,16 * * *'
jobs:
update:
name: Update data
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Update data
2023-11-02 13:47:16 +00:00
run: |
2024-07-11 06:50:11 +00:00
curl --silent --header 'Authorization: Bearer ${{secrets.token}}' --output _data/plugo.json \
'https://prod.plugo.io/api/v2/goblin/stores?lat=18.46448805396234&lng=72.12753139436244&radius=90999999'
jq ".[]|length" _data/plugo.json
2023-10-31 17:48:45 +00:00
export VERSION=`date +%Y.%-m.%-d`
sed -i "s/^version.*/version: $(VERSION)/" CITATION.cff
sed -i "s/^date-released.*/date-released: `date --rfc-3339=date`/" CITATION.cff
2024-06-21 14:20:14 +00:00
pip install msgspec pygit2
python count.py
python dead-locations.py
2023-10-31 17:48:45 +00:00
# TODO: Add tag for date as well
2022-03-05 15:50:21 +00:00
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update Plugo Data
2022-04-19 05:42:01 +00:00
commit_author: 'github-actions[bot] <github-actions[bot]@users.noreply.github.com>'