From 1d6c6cb535336fc78cfa4c9a78d085bb95e22325 Mon Sep 17 00:00:00 2001 From: Hakandede Date: Mon, 31 Aug 2026 14:26:11 +0300 Subject: [PATCH] ci: publish as countly-drill-migrator and build main without a release Two problems with the previous workflow. The image name was shared with the previous, Redis-based migration service, whose tags run up to 1.9.x on Docker Hub. Publishing this service there would mix two different services in one tag series, make latest depend on release order, and let a chart default resolve to an old build. It now publishes as countly-drill-migrator, with its own tag series. The only trigger was a published release, so the sole way to obtain any image was to cut a public one. Pushes to main and manual runs now publish a main- tag as well, which is enough to test with; releases keep producing clean semver tags. Doc-only and k8s-only pushes are skipped. --- .github/workflows/docker-publish.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 19d8cd2..38525a6 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -1,15 +1,31 @@ name: Build and Push Docker Image +# Releases publish semver tags. Pushes to main (and manual runs) publish a +# main- tag instead, so a testable image exists without minting a public +# release — the previous release-only trigger meant the only way to get an +# image was to cut one. on: release: types: [published] + push: + branches: [main] + paths-ignore: + - '**.md' + - 'docs/**' + - 'k8s/**' + workflow_dispatch: concurrency: group: docker-publish-${{ github.ref }} cancel-in-progress: true +# Deliberately NOT countly-migration: that image holds the previous, +# Redis-based migration service (tags up to 1.9.x). This service coordinates +# through a chunk ledger in MongoDB instead, so it gets its own name and its +# own tag series — otherwise `latest` would flip between two different +# services and a chart default could silently pull the old one. env: - IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/countly-migration + IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/countly-drill-migrator jobs: build-and-push: @@ -33,6 +49,7 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} + type=sha,prefix=main-,enable={{is_default_branch}} flavor: | latest=auto @@ -52,3 +69,10 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max platforms: linux/amd64 + + - name: Summary + run: | + echo "### Pushed" >> "$GITHUB_STEP_SUMMARY" + echo '```' >> "$GITHUB_STEP_SUMMARY" + echo "${{ steps.meta.outputs.tags }}" >> "$GITHUB_STEP_SUMMARY" + echo '```' >> "$GITHUB_STEP_SUMMARY"