diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index e122dfd..2089c78 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -1,15 +1,17 @@ name: Docker Image on: push: - tags: - - '**' - branches: - - main + branches: [main] pull_request: + branches: [main] paths: - - .github/workflows/jaeger-dockerimage.yml - - Dockerfile - - protoc-wrapper + - .github/workflows/jaeger-dockerimage.yml + - Dockerfile + - protoc-wrapper + release: + types: [published] + # allow running release workflow manually + workflow_dispatch: jobs: build: @@ -56,3 +58,34 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max platforms: linux/amd64,linux/arm64 + + # The following steps run only on pull requests and validate + # that the new image can run successfully in Jaeger repos. + # We do not check if the generated files would be different there, + # only that the build does not fail. + + - name: Checkout Jaeger for validation + if: github.event_name == 'pull_request' + uses: actions/checkout@v4 + with: + repository: jaegertracing/jaeger + submodules: recursive + path: jaeger + + - name: Build Proto in Jaeger + if: github.event_name == 'pull_request' + working-directory: jaeger + run: make proto JAEGER_DOCKER_PROTOBUF=protobuf + + - name: Checkout jaeger-idl for validation + if: github.event_name == 'pull_request' + uses: actions/checkout@v4 + with: + repository: jaegertracing/jaeger-idl + submodules: recursive + path: jaeger-idl + + - name: Build Proto in jaeger-idl + if: github.event_name == 'pull_request' + working-directory: jaeger-idl + run: make proto PROTOC_IMAGE=protobuf