Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Daily Data Update

Daily Data Update #4

Workflow file for this run

name: Daily Data Update
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
permissions:
contents: write
jobs:
update_data:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Dependencies
run: |
pip install bonbast jdatetime
- name: Run get_next.py and aggregator.py
run: |
while true
do
yesterday=$(date -d "yesterday" +%Y/%m/%d)
if [ -f "gregorian/$yesterday" ]; then
break
fi
python get_next.py
done
python aggregator.py
- name: Check if there are any changes
id: verify_diff
run: |
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT
- name: Commit and Push Changes
if: steps.verify_diff.outputs.changed == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add gregorian/* jalali/*
git commit -m "Update data - $(date +'%Y/%m/%d')"
git push
- name: Generate artifacts
run: |
python artifact_generator.py
- name: Upload result as release
uses: ncipollo/release-action@v1
with:
artifacts: "artifact/*"
token: ${{ secrets.GITHUB_TOKEN }}
- uses: dev-drprasad/delete-older-releases@v0.3.2
with:
keep_latest: 14
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}