Files
meshcore-hub/.github/workflows/docker-mqtt-broker.yml
T
Louis King dbd68e9a9f Replace obsolete MQTT broker image with custom build, add connection retry and upgrade docs
- Add custom Dockerfile for meshcore-mqtt-broker (Node 22 Alpine, built from michaelhart/meshcore-mqtt-broker source)
- Add GitHub Actions workflow for weekly multi-arch MQTT broker image builds
- Add local build script (etc/docker/meshcore-mqtt-broker/build.sh)
- Update docker-compose.yml and test compose to use new ghcr.io image
- Add MQTT connection retry logic with exponential backoff to collector subscriber
- Create UPGRADING.md with migration guide for breaking changes
- Update README.md and AGENTS.md for accuracy (Python 3.14, removed commands, fixed MQTT defaults)
- Remove obsolete files (etc/mosquitto.conf, .agentmap.yaml, CLAUDE.md)
2026-04-13 22:27:39 +01:00

76 lines
2.0 KiB
YAML

name: Build MQTT Broker Image
on:
schedule:
- cron: "0 4 * * 0"
workflow_dispatch:
inputs:
ref:
description: "Upstream ref to build (branch, tag, or SHA)"
required: false
default: "main"
env:
REGISTRY: ghcr.io
UPSTREAM_REPO: michaelhart/meshcore-mqtt-broker
IMAGE_NAME: ipnet-mesh/meshcore-mqtt-broker
jobs:
build:
name: Build and Push MQTT Broker
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout this repo (sparse)
uses: actions/checkout@v6
with:
sparse-checkout: |
etc/docker/meshcore-mqtt-broker
- name: Checkout upstream source
uses: actions/checkout@v6
with:
repository: ${{ env.UPSTREAM_REPO }}
ref: ${{ inputs.ref || 'main' }}
path: upstream
- name: Copy Dockerfile into upstream source
run: cp etc/docker/meshcore-mqtt-broker/Dockerfile upstream/Dockerfile
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to Container Registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v6
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v7
with:
context: ./upstream
file: ./upstream/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max