From 03a71527b4e6d95bc0f9bebc5f52b67345652a26 Mon Sep 17 00:00:00 2001 From: SBCrumb Date: Wed, 24 Sep 2025 08:39:49 -0400 Subject: [PATCH] feat: Add version-gitea tags to main branch builds Updated main workflow to create version-gitea tagged images (e.g. 1.7.0-gitea) alongside the standard latest tag. This provides clear identification that the image came from the Gitea build system and includes the version number for easy tracking. Main branch images will now be available as: - sbcrumb/nfoguard:latest (standard) - sbcrumb/nfoguard:1.7.0-gitea (versioned Gitea build) --- .gitea/workflows/ci.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 3821c60..0f428a2 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -97,11 +97,15 @@ jobs: # Build with cache (if available) echo "Building with layer caching..." + VERSION=$(cat VERSION 2>/dev/null || echo "unknown") + echo "Building version: $VERSION" + docker build \ $CACHE_ARGS \ --build-arg GIT_BRANCH=main \ --build-arg BUILD_SOURCE=gitea \ --tag nfoguard:latest \ + --tag nfoguard:${VERSION}-gitea \ --tag nfoguard:${{ github.sha }} \ --tag "$CACHE_IMAGE" \ . @@ -141,7 +145,9 @@ jobs: echo "✅ Login succeeded with direct method" # Tag for local registry (cache image already tagged in build step) + VERSION=$(cat VERSION 2>/dev/null || echo "unknown") docker tag nfoguard:latest "$LOCAL_REGISTRY/sbcrumb/nfoguard:latest" + docker tag nfoguard:${VERSION}-gitea "$LOCAL_REGISTRY/sbcrumb/nfoguard:${VERSION}-gitea" docker tag nfoguard:latest "$LOCAL_REGISTRY/sbcrumb/nfoguard:${{ github.sha }}" echo "Pushing to LOCAL registry (gigabit speed!)..." @@ -154,6 +160,11 @@ jobs: if timeout 120 docker --config $DOCKER_CONFIG push "$LOCAL_REGISTRY/sbcrumb/nfoguard:latest"; then echo "✅ Latest tag pushed successfully to LOCAL registry" + echo "=== Pushing version-gitea tag ===" + if timeout 60 docker --config $DOCKER_CONFIG push "$LOCAL_REGISTRY/sbcrumb/nfoguard:${VERSION}-gitea"; then + echo "✅ Version-gitea tag pushed successfully: ${VERSION}-gitea" + fi + echo "=== Pushing SHA tag to LOCAL IP ===" if timeout 60 docker --config $DOCKER_CONFIG push "$LOCAL_REGISTRY/sbcrumb/nfoguard:${{ github.sha }}"; then echo "✅ SHA tag pushed successfully to LOCAL registry" @@ -183,10 +194,14 @@ jobs: echo "" echo "🎉 Local build completed successfully!" echo "" + VERSION=$(cat VERSION 2>/dev/null || echo "unknown") echo "📦 Available images:" - echo " Local Docker: nfoguard:latest" - echo " Local SHA: nfoguard:${{ github.sha }}" - echo " Local Gitea: 192.168.253.221:3000/sbcrumb/nfoguard:latest" + echo " Local Docker: nfoguard:latest" + echo " Version tag: nfoguard:${VERSION}-gitea" + echo " Local SHA: nfoguard:${{ github.sha }}" + echo " Local Gitea: 192.168.253.221:3000/sbcrumb/nfoguard:latest" + echo "" + echo "🐳 Pull with: docker pull 192.168.253.221:3000/sbcrumb/nfoguard:${VERSION}-gitea" deploy: needs: build