Update Verivox Data DE #19936
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 Verivox Data DE | |
| on: | |
| # Schedule makes this bot run in regular intervals, without any interventions (GMT timezone) | |
| schedule: | |
| - cron: "10 6,7,8,9,11,13,15,17,19,21 * * *" | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: bots/verivox-de/ | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y libxml2-dev libcurl4-openssl-dev libssl-dev | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Install node packages | |
| run: | | |
| npm install -g @nzz/q-cli | |
| npm install -g mapshaper | |
| npm audit fix --force | |
| - name: Setup python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10.5" | |
| - name: Get pip cache dir | |
| id: pip-cache | |
| run: | | |
| echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT | |
| - name: Cache python packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.pip-cache.outputs.dir }} | |
| key: ${{ runner.os }}-pip-${{ hashFiles('./bots/verivox-de/requirements.txt') }} | |
| - name: Install python packages | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Create Snowflake Private Key File | |
| run: printf '%s\n' "$VERIVOX_SNOWFLAKE_KEY" > private_key.pem | |
| shell: bash | |
| env: | |
| VERIVOX_SNOWFLAKE_KEY: ${{ secrets.VERIVOX_SNOWFLAKE_KEY }} | |
| - name: Run python scripts | |
| run: | | |
| timeout 300 python -u agsi-gas-storage.py | |
| timeout 300 python -u entsog-imports.py | |
| timeout 300 python -u bnetza-exporte.py | |
| timeout 300 python -u ttf-gas-stock.py | |
| # python epex-spot-ac.py | |
| timeout 300 python -u bkarta-sprit.py | |
| # python bnetza-verbrauch.py | |
| timeout 300 python -u verivox-daily-new.py | |
| timeout 300 python -u imports-countries.py | |
| timeout 800 python -u smard-sources.py | |
| # execute smard-sources.py after imports-countries.py | |
| timeout 300 python -u eex-futures.py | |
| timeout 300 python -u verivox-daily-diff.py | |
| timeout 300 python -u gas-dashboard.py | |
| env: | |
| DATAWRAPPER_API: ${{ secrets.DATAWRAPPER_API }} | |
| VERIVOX_SNOWFLAKE_USER: ${{ secrets.VERIVOX_SNOWFLAKE_USER }} | |
| VERIVOX_SNOWFLAKE_ACC: ${{ secrets.VERIVOX_SNOWFLAKE_ACC }} | |
| VERIVOX_SNOWFLAKE_KEY: "private_key.pem" | |
| VERIVOX_SNOWFLAKE_KEY_PASS: ${{ secrets.VERIVOX_SNOWFLAKE_KEY_PASS }} | |
| - name: Run Q cli | |
| run: Q update-item | |
| env: | |
| Q_PRODUCTION_SERVER: ${{ secrets.Q_PRODUCTION_SERVER }} | |
| Q_PRODUCTION_ACCESSTOKEN: ${{ secrets.Q_PRODUCTION_ACCESSTOKEN }} | |
| - uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| file_pattern: :!*.json | |
| commit_message: Update Verivox data | |
| - name: Log failure to slack | |
| if: always() | |
| uses: ravsamhq/notify-slack-action@2.5.0 | |
| with: | |
| status: ${{ job.status }} | |
| notify_when: "failure" | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_DE_SLACK }} |