aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2026-07-10 12:45:02 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2026-07-10 12:45:02 -0700
commit18a4d5a1384e37c9eea842a9f927d050869a02dd (patch)
treeafb570e229050f63401d6ab619336d50accb436e
parent6b332f116dd50fe40cf6fe33c36e9fa25b6f31c1 (diff)
Publish moving edge image on master pushes
Build and push ghcr.io/jhalter/mobius-hotline-server:edge on every push to master so unreleased builds can be tested without cutting a release. Pin metadata-action tags explicitly (tag ref + edge on master) so the existing latest/semver release tags are preserved, and make the Dockerfile version stamp fall back to git describe --always so non-tag builds don't produce an empty version.
-rw-r--r--.github/workflows/docker-publish.yml5
-rw-r--r--Dockerfile2
2 files changed, 6 insertions, 1 deletions
diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml
index dd6e2d8..387709b 100644
--- a/.github/workflows/docker-publish.yml
+++ b/.github/workflows/docker-publish.yml
@@ -2,6 +2,8 @@ name: Docker
on:
push:
+ branches:
+ - master
tags:
- '*'
@@ -57,6 +59,9 @@ jobs:
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
+ tags: |
+ type=ref,event=tag
+ type=edge,branch=master
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
diff --git a/Dockerfile b/Dockerfile
index 414ed9c..6f57ced 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,7 +3,7 @@ FROM golang:1.25 AS builder
WORKDIR /app
COPY . .
-RUN CGO_ENABLED=0 go build -ldflags "-X main.version=$(git describe --exact-match --tags)" -o /app/server cmd/mobius-hotline-server/main.go && chmod a+x /app/server
+RUN CGO_ENABLED=0 go build -ldflags "-X main.version=$(git describe --tags --always --dirty)" -o /app/server cmd/mobius-hotline-server/main.go && chmod a+x /app/server
FROM scratch