From 5d40f2c5ce51cba53fbe61fb14b87c603bcd5fc6 Mon Sep 17 00:00:00 2001 From: Daniel Chalef <131175+danielchalef@users.noreply.github.com> Date: Tue, 26 Aug 2025 20:26:56 -0700 Subject: [PATCH] fix: Docker workflow should only build on push to main, not PRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove pull_request trigger from Docker build workflow - Add dockerfile path to fix build error - Update conditional logic for login and push steps 🤖 Generated with Claude Code Co-Authored-By: Claude --- .github/workflows/mcp-server-docker.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/mcp-server-docker.yml b/.github/workflows/mcp-server-docker.yml index 67002d1a..3bff452c 100644 --- a/.github/workflows/mcp-server-docker.yml +++ b/.github/workflows/mcp-server-docker.yml @@ -6,11 +6,6 @@ on: - "mcp_server/pyproject.toml" branches: - main - pull_request: - paths: - - "mcp_server/pyproject.toml" - branches: - - main workflow_dispatch: inputs: push_image: @@ -41,7 +36,7 @@ jobs: echo "version=$VERSION" >> $GITHUB_OUTPUT echo "tag=v$VERSION" >> $GITHUB_OUTPUT - name: Log in to Docker Hub - if: github.event_name != 'pull_request' && (github.event_name != 'workflow_dispatch' || inputs.push_image) + if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push_image) uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} @@ -58,7 +53,6 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=ref,event=branch - type=ref,event=pr type=raw,value=${{ steps.version.outputs.tag }} type=raw,value=latest,enable={{is_default_branch}} @@ -67,7 +61,8 @@ jobs: with: project: v9jv1mlpwc context: ./mcp_server + file: ./mcp_server/docker/Dockerfile platforms: linux/amd64,linux/arm64 - push: ${{ github.event_name != 'pull_request' && (github.event_name != 'workflow_dispatch' || inputs.push_image) }} + push: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push_image) }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}