From 529ddbc195fbde58aaeaf2f8f3ca06570397d75e Mon Sep 17 00:00:00 2001 From: makinje Date: Sun, 27 Sep 2026 21:06:33 -0500 Subject: [PATCH] ci: validate observer Docker builds Build the observer image for linux/amd64 on pull requests and pushes to main using the repository root context. Cache build layers without publishing an image or logging into a registry. Validation: actionlint passes; the current Dockerfile builds successfully; removing COPY pkg/ reproduces the missing pkg/topology build failure. Fixes #687 Signed-off-by: makinje --- .github/workflows/observer-build.yaml | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/observer-build.yaml diff --git a/.github/workflows/observer-build.yaml b/.github/workflows/observer-build.yaml new file mode 100644 index 00000000..b39c024d --- /dev/null +++ b/.github/workflows/observer-build.yaml @@ -0,0 +1,44 @@ +name: Observer Docker build + +on: + pull_request: + paths-ignore: + - "**/*.md" + - "**/*.txt" + push: + branches: + - main + paths-ignore: + - "**/*.md" + - "**/*.txt" + +permissions: + contents: read + +concurrency: + group: observer-build-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + observer-build: + name: Build observer image + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Check out code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Set up Docker buildx + uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0 + + - name: Build observer image + uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 + with: + context: . + file: tools/observer/Dockerfile + platforms: linux/amd64 + push: false + cache-from: type=gha,scope=observer-build + cache-to: type=gha,mode=max,scope=observer-build