Poll data #78091
This file contains 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: Poll data | |
concurrency: | |
group: poll-data | |
# Requires these repository secrets: | |
# TELEGRAM_TOKEN - a token for the Telegram bot API | |
# TELEGRAM_DEBUG_CHAT_ID - the ID of the private Telegram channel | |
# TELEGRAM_PUBLIC_CHAT_ID - the ID of the public Telegram channel | |
# GENESIS_LFSTAT_USERNAME - Genesis LfStat Bayern credentials | |
# GENESIS_LFSTAT_PASSWORD - Genesis LfStat Bayern credentials | |
# GITHUB_PAT - a personal access token with the repo scope | |
on: | |
schedule: | |
- cron: '*/20 * * * *' # Every 20 minutes | |
workflow_dispatch: | |
jobs: | |
poll-data: | |
environment: vaterstetten-in-zahlen.de | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install APT requirements | |
run: sudo apt update && sudo apt install -y libkrb5-dev | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install pipenv | |
run: pip install --ignore-installed pipenv==2023.2.18 | |
- name: Install python packages | |
run: pipenv sync | |
- name: Run python script | |
run: pipenv run python tools/poll.py | |
env: | |
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
TELEGRAM_DEBUG_CHAT_ID: ${{ secrets.TELEGRAM_DEBUG_CHAT_ID }} | |
TELEGRAM_PUBLIC_CHAT_ID: ${{ secrets.TELEGRAM_PUBLIC_CHAT_ID }} | |
GENESIS_LFSTAT_USERNAME: ${{ secrets.GENESIS_LFSTAT_USERNAME }} | |
GENESIS_LFSTAT_PASSWORD: ${{ secrets.GENESIS_LFSTAT_PASSWORD }} | |
continue-on-error: true | |
timeout-minutes: 10 | |
- name: Commit | |
id: auto-commit-action | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: automatic data update | |
commit_user_name: GitHub Actions | |
commit_user_email: [email protected] | |
commit_author: GitHub Actions <[email protected]> | |
- if: steps.auto-commit-action.outputs.changes_detected == 'true' | |
name: Trigger Deploy workflow | |
uses: benc-uk/workflow-dispatch@v1 | |
with: | |
workflow: Deploy | |
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} |