Skip to content

Update Food Prices DE #1796

Update Food Prices DE

Update Food Prices DE #1796

Workflow file for this run

name: Update Food Prices DE
on:
# Schedule makes this bot run in regular intervals, without any interventions
schedule:
- cron: "0,10 10 * * *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: bots/crawl-rewe-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 language-pack-de
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install node packages
run: |
npm install -g @nzz/q-cli
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: "3.10.x"
- 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/corona-charts-de/requirements.txt') }}
- name: Install python packages
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run python scripts
run: |
python crawl-rewe.py
- 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: '*.csv *-ja-*.json'
commit_message: Upload csv with food prices
- name: Log failure to slack
if: always()
uses: ravsamhq/[email protected]
with:
status: ${{ job.status }}
notify_when: "failure"
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_DE_SLACK }}