Skip to content

Commit 7243214

Browse files
feat: add CI workflow for Docker image publishing to GHCR and update README with Docker volume creation instructions
1 parent 6302a1d commit 7243214

2 files changed

Lines changed: 39 additions & 18 deletions

File tree

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,39 @@ jobs:
2727

2828
- name: Build
2929
run: CGO_ENABLED=1 go build -o netmon ./cmd/netmon
30+
31+
publish:
32+
name: Publish Docker image to GHCR
33+
runs-on: ubuntu-latest
34+
needs: build
35+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
36+
37+
permissions:
38+
contents: read
39+
packages: write
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- name: Log in to GHCR
45+
uses: docker/login-action@v3
46+
with:
47+
registry: ghcr.io
48+
username: ${{ github.actor }}
49+
password: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: Extract metadata
52+
id: meta
53+
uses: docker/metadata-action@v5
54+
with:
55+
images: ghcr.io/${{ github.repository }}
56+
tags: |
57+
type=raw,value=latest
58+
59+
- name: Build and push
60+
uses: docker/build-push-action@v6
61+
with:
62+
context: .
63+
push: true
64+
tags: ${{ steps.meta.outputs.tags }}
65+
labels: ${{ steps.meta.outputs.labels }}

README.md

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ A lightweight, self-hosted network monitoring dashboard. Tracks latency, jitter,
66
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
77
[![Go](https://img.shields.io/badge/Go-1.21+-00ADD8?logo=go)](https://golang.org)
88

9-
---
109

1110
## Features
1211

@@ -17,7 +16,6 @@ A lightweight, self-hosted network monitoring dashboard. Tracks latency, jitter,
1716
- **SQLite storage** — no database server; data persists in a single file
1817
- **Cross-platform** — runs on Linux (x86, ARM/Pi), macOS, Windows, and Docker
1918

20-
---
2119

2220
## Quick Start
2321

@@ -29,6 +27,9 @@ docker run -d \
2927
--network host \
3028
-v netmon-data:/data \
3129
ghcr.io/decoded-cipher/netmon:latest
30+
31+
# create the volume first if it doesn't exist
32+
docker volume create netmon-data
3233
```
3334

3435
Or with Docker Compose:
@@ -61,7 +62,6 @@ make docker # build Docker image
6162
make docker-run # build + run Docker container
6263
```
6364

64-
---
6565

6666
## Configuration
6767

@@ -76,7 +76,6 @@ All defaults live in `internal/monitor/monitor.go → DefaultConfig()`. There is
7676
| Speed test size | `1 MB` | Payload size (kept small to avoid hogging the link) |
7777
| HTTP port | `:8080` | Dashboard address |
7878

79-
---
8079

8180
## Architecture
8281

@@ -96,7 +95,6 @@ web/
9695
2. `speedWorker` downloads/uploads 1 MB to Cloudflare every 30 min — updates latest bandwidth values
9796
3. Dashboard polls `GET /api/data` every 30s and renders charts client-side
9897

99-
---
10098

10199
## Platforms
102100

@@ -115,23 +113,10 @@ GOOS=linux GOARCH=arm64 CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc \
115113
go build -o netmon ./cmd/netmon
116114
```
117115

118-
---
119116

120117
## Requirements
121118

122119
- **Go 1.21+** for building from source
123120
- **CGO enabled** (`CGO_ENABLED=1`) — required by the SQLite driver (`go-sqlite3`)
124121
- A C compiler (`gcc` / `musl-gcc` / `clang`) at build time; not needed at runtime
125122
- `ping` available in `PATH` at runtime (standard on all platforms)
126-
127-
---
128-
129-
## Contributing
130-
131-
See [CONTRIBUTING.md](CONTRIBUTING.md).
132-
133-
---
134-
135-
## License
136-
137-
[MIT](LICENSE)

0 commit comments

Comments
 (0)