Skip to content

Commit

Permalink
Added docker image pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
foorschtbar committed Jul 27, 2024
1 parent 0608f84 commit d5662e3
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build Docker Image

on: [push]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-image:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop'
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
id: push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}


20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,26 @@ A Telegram Bot written in Python for the great [Strichliste](https://github.com/
[![Screenshot](.github/demo-thumb.jpg)](.github/demo.jpg)

## Usage

- Get bot token form Telegram Bot Father

### Docker

- Map the config file and authorized users file to the container

```yml
services:
telegram:
image: ghcr.io/westwoodlabs/strichliste-telegram
restart: unless-stopped
volumes:
- ./data/telegram/authorizedUsers.json:/usr/src/app/authorizedUsers.json
- ./data/telegram/config.py:/usr/src/app/config.py
```
### systemd-Deamon
- Rename config.default.py to config.py and change parameters
- Start script ./bot.py
## systemd-Deamon
See [sltgbridge.service](sltgbridge.service)
```
Expand All @@ -33,4 +49,4 @@ RestartSec=3
[Install]
WantedBy=multi-user.target

```
```

0 comments on commit d5662e3

Please sign in to comment.