fix python reqs, add Dockerfile, github actions

This commit is contained in:
Jan Koppe 2021-10-16 19:59:17 +02:00
parent 351190dec4
commit 8f9eb7393b
Signed by: thunfisch
GPG Key ID: BE935B0735A2129B
4 changed files with 40 additions and 1 deletions

31
.github/workflows/build-and-publish.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: Build and Publish
on:
push:
branches:
- 'master'
pull_request:
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Github Packages
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: ${{ github.ref == 'refs/heads/main' }}
tags: chaoswest-tv/durchsage:latest

7
Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM python:3.9-alpine
ENV TZ=UTC
WORKDIR /app
ADD requirements.txt .
RUN apk add --no-cache tzdata && pip install -r requirements.txt
ADD durchsage.py .
CMD python durchsage.py

View File

@ -163,7 +163,7 @@ def announce_event(fahrplan: str, event: dict, pre: bool = False) -> None:
""" """
Takes an event dict and announces it by sending it onto the configured MQTT topic. Takes an event dict and announces it by sending it onto the configured MQTT topic.
""" """
l.info("[%s] announcing event %s" % (fahrplan, event['guid'])) l.info("%s - announcing event %s" % (fahrplan, event['guid']))
sub_topic = 'soon' if pre else 'now' sub_topic = 'soon' if pre else 'now'
msg = json.dumps(event) msg = json.dumps(event)

View File

@ -1,3 +1,4 @@
apscheduler apscheduler
python-dateutil
requests requests
paho-mqtt paho-mqtt