Skip to content

Commit 15ba418

Browse files
Copilotdarthkali
andauthored
Fix: Only push Docker images on main branch pushes (#31)
* Initial plan * Fix: Only push Docker images on main branch pushes - Add conditional logic to frontend and backend build jobs - Images are built for all branches but only pushed on main branch pushes - Prevents image publishing on pull requests and other events Co-authored-by: darthkali <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: darthkali <[email protected]>
1 parent e878987 commit 15ba418

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/build-and-push.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
file: frontend/Dockerfile
5050
build-args: |
5151
VERSION=${{ env.VERSION }}
52-
push: true
52+
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
5353
tags: |
5454
${{ env.RAG_EVAL_UI_IMAGE }}:${{ env.SHORT_SHA }}
5555
${{ github.ref_type == 'tag' &&
@@ -98,7 +98,7 @@ jobs:
9898
file: backend/Dockerfile
9999
build-args: |
100100
VERSION=${{ env.VERSION }}
101-
push: true
101+
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
102102
tags: |
103103
${{ env.LLM_EVAL_BACKEND_IMAGE }}:${{ env.SHORT_SHA }}
104104
${{ github.ref_type == 'tag' &&

0 commit comments

Comments
 (0)