fix: Docker workflow should only build on push to main, not PRs

- 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 <noreply@anthropic.com>
This commit is contained in:
Daniel Chalef 2025-08-26 20:26:56 -07:00
parent 01021af9c2
commit 5d40f2c5ce

View file

@ -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 }}