Update BOM Forecast #6
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 BOM Forecast | |
| on: | |
| schedule: | |
| # Run 30 mins after BOM forecast updates (17:00, 23:00, 05:00, 11:00 UTC) | |
| - cron: '30 5,11,17,23 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| update-forecast: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.9' | |
| - name: Install dependencies | |
| run: | | |
| pip install --upgrade pip | |
| pip install requests beautifulsoup4 pandas matplotlib numpy | |
| - name: Generate forecast plots | |
| run: python _scripts/generate_forecast.py | |
| - name: Commit and push changes | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add images/bom_forecast_*.png files/forecast_metadata.json | |
| git commit -m "Update BOM forecast plots" --allow-empty | |
| git push |