From 9f04665e879ac416108e67337474a2cdea9b8a7b Mon Sep 17 00:00:00 2001 From: Groom Book CTO Date: Tue, 17 Mar 2026 22:22:00 +0000 Subject: [PATCH] Update CI to push Docker images to ghcr.io Enable image pushing to GitHub Container Registry on main branch merges. Tags images with both commit SHA and latest. Co-Authored-By: Paperclip --- .github/workflows/ci.yml | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dfc4c9b..6ae12ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,32 +69,46 @@ jobs: run: pnpm build docker: - name: Build Docker Images + name: Build & Push Docker Images runs-on: ubuntu-latest needs: [build] if: github.ref == 'refs/heads/main' + permissions: + contents: read + packages: write steps: - uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Build API image + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push API image uses: docker/build-push-action@v6 with: context: . file: apps/api/Dockerfile - push: false - tags: groombook/api:${{ github.sha }} + push: true + tags: | + ghcr.io/groombook/api:${{ github.sha }} + ghcr.io/groombook/api:latest cache-from: type=gha cache-to: type=gha,mode=max - - name: Build Web image + - name: Build and push Web image uses: docker/build-push-action@v6 with: context: . file: apps/web/Dockerfile - push: false - tags: groombook/web:${{ github.sha }} + push: true + tags: | + ghcr.io/groombook/web:${{ github.sha }} + ghcr.io/groombook/web:latest cache-from: type=gha cache-to: type=gha,mode=max