Skip to content

Commit efc2b08

Browse files
itsDNNSclaude
andcommitted
Add GitHub Actions CI/CD for GHCR image publishing
- Docker image auto-builds on push to master - Published to ghcr.io/itsdnns/fritzbox-docsis-monitor:latest - docker-compose.yml uses image with build fallback - deploy.sh added locally (gitignored) for NAS deployment Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e61b5e8 commit efc2b08

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

.github/workflows/docker.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches: [master]
6+
workflow_dispatch:
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
12+
jobs:
13+
build-and-push:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Log in to GHCR
24+
uses: docker/login-action@v3
25+
with:
26+
registry: ${{ env.REGISTRY }}
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Extract metadata
31+
id: meta
32+
uses: docker/metadata-action@v5
33+
with:
34+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
35+
tags: |
36+
type=raw,value=latest
37+
type=sha,prefix=
38+
39+
- name: Build and push
40+
uses: docker/build-push-action@v6
41+
with:
42+
context: .
43+
push: true
44+
tags: ${{ steps.meta.outputs.tags }}
45+
labels: ${{ steps.meta.outputs.labels }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ __pycache__/
55
*.pyc
66
.vscode/
77
.idea/
8+
deploy.sh

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
services:
22
fritzbox-docsis-monitor:
3+
image: ghcr.io/itsdnns/fritzbox-docsis-monitor:latest
34
build: .
45
container_name: fritzbox-docsis-monitor
56
restart: unless-stopped

0 commit comments

Comments
 (0)