-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (55 loc) · 2.09 KB
/
poll-data.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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 }}