From aba23cb9dfe8505324fb223fdef51d722a050f2f Mon Sep 17 00:00:00 2001 From: Manav Gupta Date: Sun, 7 Sep 2025 03:51:08 -0400 Subject: [PATCH] Fix Docker registry and CI build issues - Remove Docker push from CI workflow (only build, no push on PRs) - Remove Docker login from CI workflow (not needed for building) - Add id-token permission to publish workflow - Add continue-on-error to Docker login in publish workflow - Simplify CI build step to only build images, not push them This should fix both the CI build failure and the Docker registry authentication issues in the publish workflow. --- .github/workflows/ci.yml | 27 ++------------------------- .github/workflows/publish.yml | 2 ++ 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 558de912..6bd720c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e8be2d33..0646cdff 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,6 +7,7 @@ on: permissions: contents: read packages: write + id-token: write jobs: build-and-publish: @@ -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