daily-update #1325
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: daily-update | |
| 'on': | |
| schedule: | |
| - cron: '11 11 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| update-data: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout repo content | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| - name: setup python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.9.14" | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Patch bblocks packages | |
| run: | | |
| sed -i 's/coco_logger = coco.logging.getLogger()/#coco_logger = coco.logging.getLogger()/' .venv/lib/python*/site-packages/bblocks_data_importers/utilities.py | |
| sed -i 's/coco_logger.setLevel(logging.CRITICAL)/#coco_logger.setLevel(logging.CRITICAL)/' .venv/lib/python*/site-packages/bblocks_data_importers/utilities.py | |
| sed -i 's/weo = WorldEconomicOutlook().load_data/weo = WorldEconomicOutlook(year=2025, release=1).load_data/' .venv/lib/python*/site-packages/bblocks/dataframe_tools/common.py | |
| - name: Run daily update | |
| env: | |
| IPC_API: ${{ secrets.IPC_API }} | |
| run: uv run python update_daily.py | |
| - name: Save changes | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Actions [bot]" | |
| git add . | |
| git commit -m "Run daily update" | |
| - name: push changes | |
| uses: ad-m/github-push-action@v1.0.0 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Deploy download folder to GitHub Pages | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| branch: gh-pages # The branch the action should deploy to. | |
| folder: charts_download # The folder the action should deploy. | |
| git-config-name: "GitHub Actions [bot]" | |
| git-config-email: "action@github.com" |