Skip to content
This repository was archived by the owner on Aug 14, 2026. It is now read-only.

Commit b669b76

Browse files
committed
Add Docker Hub publish
1 parent d8c328d commit b669b76

3 files changed

Lines changed: 70 additions & 3 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Docker Build and Publish
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
tags: [ 'v*' ]
7+
workflow_dispatch:
8+
9+
env:
10+
REGISTRY: docker.io
11+
IMAGE_NAME: loganhan123/deye-force-discharger
12+
13+
jobs:
14+
build-and-push:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v3
23+
24+
- name: Log in to Docker Hub
25+
uses: docker/login-action@v3
26+
with:
27+
username: ${{ secrets.DOCKERHUB_USERNAME }}
28+
password: ${{ secrets.DOCKERHUB_TOKEN }}
29+
30+
- name: Extract metadata (tags, labels)
31+
id: meta
32+
uses: docker/metadata-action@v5
33+
with:
34+
images: ${{ env.IMAGE_NAME }}
35+
tags: |
36+
type=ref,event=branch
37+
type=semver,pattern={{version}}
38+
type=semver,pattern={{major}}.{{minor}}
39+
type=raw,value=latest,enable={{is_default_branch}}
40+
41+
- name: Build and push Docker image
42+
uses: docker/build-push-action@v5
43+
with:
44+
context: .
45+
push: true
46+
tags: ${{ steps.meta.outputs.tags }}
47+
labels: ${{ steps.meta.outputs.labels }}
48+
cache-from: type=gha
49+
cache-to: type=gha,mode=max
50+
platforms: linux/amd64,linux/arm64

‎README.md‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Deye Force Discharger
22

3+
[![Docker Hub](https://img.shields.io/docker/v/loganhan123/deye-force-discharger?label=Docker%20Hub&logo=docker)](https://hub.docker.com/r/loganhan123/deye-force-discharger)
4+
[![Docker Pulls](https://img.shields.io/docker/pulls/loganhan123/deye-force-discharger)](https://hub.docker.com/r/loganhan123/deye-force-discharger)
5+
36
A Python application to automate battery discharge scheduling for Deye hybrid inverters via the Deye Cloud API.
47

58
![Web Interface](screenshot.png)
@@ -59,7 +62,20 @@ When you configure your solar system capacity, the application displays estimate
5962

6063
## Installation & Setup
6164

62-
### Quick Start
65+
### Quick Start with Docker Hub
66+
67+
```bash
68+
# Pull and run the container
69+
docker run -d \
70+
--name deye-force-discharger \
71+
-p 7777:7777 \
72+
-v $(pwd)/config.json:/app/config.json \
73+
-e TZ=Australia/Sydney \
74+
--restart unless-stopped \
75+
loganhan123/deye-force-discharger:latest
76+
```
77+
78+
### Using Docker Compose
6379

6480
```bash
6581
# Start the container

‎docker-compose.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ version: '3.8'
22

33
services:
44
deye-force-discharger:
5-
build: .
6-
image: deye-force-discharger:latest
5+
image: loganhan123/deye-force-discharger:latest
6+
# Uncomment below to build locally instead
7+
# build: .
78
container_name: deye-force-discharger
89
restart: unless-stopped
910
ports:

0 commit comments

Comments
 (0)