aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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