From 7949b01ec82de121f5c64db2a0c7f7b1a21f403a Mon Sep 17 00:00:00 2001 From: "avi@robusta.dev" Date: Sun, 18 Oct 2026 10:03:38 +0300 Subject: [PATCH] Build and push amd64/arm64 images to GCR and Docker Hub on release Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/robusta-build.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/robusta-build.yml b/.github/workflows/robusta-build.yml index 3eff89d9c6..6c9a6170ae 100644 --- a/.github/workflows/robusta-build.yml +++ b/.github/workflows/robusta-build.yml @@ -19,6 +19,8 @@ on: push: branches: - 'robusta-build/**' + release: + types: [published] # Cancel in-progress runs for the same ref concurrency: @@ -27,8 +29,12 @@ concurrency: jobs: build: + if: github.event_name != 'release' || contains(github.ref_name, 'robusta') runs-on: ${{ matrix.runner }} + env: + PUSH_DOCKERHUB: ${{ github.event_name == 'release' || github.event.inputs.push_dockerhub == 'true' }} + strategy: fail-fast: false matrix: @@ -54,6 +60,8 @@ jobs: run: | if [ -n "${{ github.event.inputs.image_tag }}" ]; then TAG='${{ github.event.inputs.image_tag }}' + elif [ "${{ github.event_name }}" = "release" ]; then + TAG='${{ github.ref_name }}' else BRANCH="${GITHUB_REF#refs/heads/}" TAG="${BRANCH#robusta-build/}" @@ -76,7 +84,7 @@ jobs: run: gcloud auth configure-docker us-central1-docker.pkg.dev --quiet - name: Login to Docker Hub - if: github.event.inputs.push_dockerhub == 'true' + if: env.PUSH_DOCKERHUB == 'true' uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} @@ -98,7 +106,7 @@ jobs: cache-to: type=gha,mode=max,scope=${{ matrix.arch }} - name: Build and push (Docker Hub, opt-in) - if: github.event.inputs.push_dockerhub == 'true' + if: env.PUSH_DOCKERHUB == 'true' uses: docker/build-push-action@v6 with: context: . @@ -117,7 +125,7 @@ jobs: echo '' echo '```' echo "us-central1-docker.pkg.dev/genuine-flight-317411/devel/realtime:${{ steps.tag.outputs.tag }}${{ matrix.tag_suffix }}" - if [ "${{ github.event.inputs.push_dockerhub }}" = "true" ]; then + if [ "$PUSH_DOCKERHUB" = "true" ]; then echo "robustadev/realtime:${{ steps.tag.outputs.tag }}${{ matrix.tag_suffix }}" fi echo '```'