This commit is contained in:
Krzysztof
2025-08-03 15:03:52 +02:00
parent 34336b2de6
commit 3899e761f2
2 changed files with 7 additions and 1 deletions

View File

@@ -20,6 +20,10 @@ jobs:
fetch-depth: 0
fetch-tags: true
- name: Get version from Git
id: version
run: echo "VERSION=$(git describe --tags)" >> $GITHUB_ENV
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
@@ -41,6 +45,8 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=${{ env.VERSION }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2

View File

@@ -8,7 +8,7 @@ RUN go mod download
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -o uptimemonitor \
-ldflags "-X uptimemonitor/pkg/version.Version=$(git describe --tags)" \
-ldflags "-X uptimemonitor/pkg/version.Version=${VERSION:-$(git describe --tags)}" \
./cmd/uptimemonitor
FROM alpine:latest