Update data #1203
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update data | |
| on: | |
| schedule: | |
| - cron: 35 11 * * * # 6:35 PM in Vietnam | |
| jobs: | |
| update-data: | |
| if: github.repository_owner == 'khiemdoan' | |
| runs-on: ubuntu-slim | |
| steps: | |
| - name: Checkout repo content | |
| uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: uv sync --frozen --no-dev --no-install-project | |
| - name: Fetch data | |
| run: uv run src/fetch.py | |
| - name: Analyze data | |
| run: uv run src/analyze.py | |
| - name: Commit changes | |
| run: | | |
| if git diff --quiet; then | |
| echo "No changes to commit" | |
| exit 0 | |
| fi | |
| git config --global user.email "action@github.com" | |
| git config --global user.name "GitHub Action" | |
| git add . | |
| git commit -m "Updated $(date +'%Y-%m-%d')" | |
| git push origin main |