Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 2 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,7 @@ jobs:
restore-keys: |
${{ runner.os }}-buildx-

- name: Login to GitHub Container Registry
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push images
- name: Build images (no push on PRs)
id: build
run: |
# Build with commit SHA for uniqueness
Expand All @@ -167,22 +159,7 @@ jobs:
echo "Building frontend image..."
docker build -t $FRONTEND_TAG -f ./webui/Dockerfile.frontend ./webui

# Only push images on main branch pushes (not PRs)
if [ "${{ github.event_name }}" == "push" ] && [ "${{ github.ref }}" == "refs/heads/main" ]; then
# Also tag as latest for compose compatibility
docker tag $BACKEND_TAG ghcr.io/manavgup/rag_modulo/backend:latest
docker tag $FRONTEND_TAG ghcr.io/manavgup/rag_modulo/frontend:latest

echo "Pushing images to GHCR..."
# Push images to GHCR
docker push $BACKEND_TAG
docker push $FRONTEND_TAG
docker push ghcr.io/manavgup/rag_modulo/backend:latest
docker push ghcr.io/manavgup/rag_modulo/frontend:latest
else
echo "Skipping push to GHCR - not on main branch or not a push event"
fi

echo "Images built successfully (not pushing on PRs)"
echo "backend-image=$BACKEND_TAG" >> $GITHUB_OUTPUT
echo "frontend-image=$FRONTEND_TAG" >> $GITHUB_OUTPUT

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
permissions:
contents: read
packages: write
id-token: write

jobs:
build-and-publish:
Expand All @@ -24,6 +25,7 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true

- name: Build and push frontend
uses: docker/build-push-action@v5
Expand Down
Loading