fix python reqs, add Dockerfile, github actions
This commit is contained in:
parent
351190dec4
commit
8f9eb7393b
|
@ -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
|
|
@ -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
|
|
@ -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.
|
||||
"""
|
||||
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'
|
||||
msg = json.dumps(event)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
apscheduler
|
||||
python-dateutil
|
||||
requests
|
||||
paho-mqtt
|
Loading…
Reference in New Issue