From 0524d452c4ebd827149a64e1d4a40e3da4a64e4f Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 30 Dec 2025 13:01:45 -0500 Subject: [PATCH] Create a Github action to build the mailpopbox-router Docker image --- .github/workflows/container.yml | 31 +++++++++++++++++++++++++++++++ Makefile | 4 ++++ deployment/Dockerfile-router | 16 ++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 .github/workflows/container.yml create mode 100644 deployment/Dockerfile-router diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml new file mode 100644 index 0000000..9c4b1a7 --- /dev/null +++ b/.github/workflows/container.yml @@ -0,0 +1,31 @@ +name: container + +on: workflow_dispatch + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - id: read_version + run: echo "VERSION=$(make version)" >> $GITHUB_ENV + + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ github.token }} + + - uses: docker/setup-qemu-action@v3 + + - uses: docker/setup-buildx-action@v3 + + - uses: docker/build-push-action@v6 + platforms: linux/amd64,linux/arm64 + context: . + file: deployment/Dockerfile-router + push: true + tags: | + ghcr.io/rsesek/mailpopbox-router:latest + ghcr.io/rsesek/mailpopbox-router:${{ env.VERSION }} diff --git a/Makefile b/Makefile index e7f47f6..9d7d35a 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,10 @@ PKG_BASE=mailpopbox-$(VERSION) DOCS_FILES=README.md docs/install.md +.PHONY: +version: + @echo $(VERSION) + clean: rm -rf build || true mkdir build diff --git a/deployment/Dockerfile-router b/deployment/Dockerfile-router new file mode 100644 index 0000000..0c05565 --- /dev/null +++ b/deployment/Dockerfile-router @@ -0,0 +1,16 @@ +# mailpopbox +# Copyright 2025 Blue Static +# This program is free software licensed under the GNU General Public License, +# version 3.0. The full text of the license can be found in LICENSE.txt. +# SPDX-License-Identifier: GPL-3.0-only + +FROM golang:1.24-alpine + +WORKDIR /go/src/mailpopbox +COPY . . + +RUN go install -v ./... + +EXPOSE 80/tcp + +CMD ["/go/bin/mailpopbox-router", "/var/mailpopbox/router.json"] -- 2.43.5