From 4f634117f16cb23ae45604cd6d9cd61c0b2a3baa Mon Sep 17 00:00:00 2001 From: Jonathan Flatt Date: Thu, 22 May 2025 20:00:27 +0000 Subject: [PATCH] fix: Separate CI and deployment workflows to enable PR reviews MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move build-and-push and deploy jobs to dedicated deploy.yml workflow - CI workflow now only contains essential PR checks (test, security, docker) - Prevents skipped deployment jobs from blocking PR review automation - Fixes issue where PR #36 couldn't trigger automated reviews 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/ci.yml | 75 +-------------------------------- .github/workflows/deploy.yml | 81 ++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 74 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abaec3b..fe81833 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -152,77 +152,4 @@ jobs: # Cleanup docker stop test-webhook - docker rm test-webhook - - build-and-push: - name: Build & Push Images - runs-on: ubuntu-latest - needs: [test, security, docker] - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - - permissions: - contents: read - packages: write - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to Container Registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=ref,event=branch - type=ref,event=pr - type=sha,prefix={{branch}}- - type=raw,value=latest,enable={{is_default_branch}} - - - name: Build and push main image - uses: docker/build-push-action@v6 - with: - context: . - file: ./Dockerfile - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max - - - name: Build and push Claude Code image - uses: docker/build-push-action@v6 - with: - context: . - file: ./Dockerfile.claudecode - push: true - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-claudecode:latest - cache-from: type=gha - cache-to: type=gha,mode=max - - deploy: - name: Deploy to Staging - runs-on: ubuntu-latest - needs: [build-and-push] - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - environment: staging - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Deploy notification - run: | - echo "🚀 Deployment to staging would happen here" - echo "Image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" - # Add actual deployment logic here (e.g., update Kubernetes, docker-compose, etc.) \ No newline at end of file + docker rm test-webhook \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..3a9d760 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,81 @@ +name: Deploy + +on: + push: + branches: [ main ] + +env: + NODE_VERSION: '20' + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push: + name: Build & Push Images + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=sha,prefix={{branch}}- + type=raw,value=latest,enable={{is_default_branch}} + + - name: Build and push main image + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: Build and push Claude Code image + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile.claudecode + push: true + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-claudecode:latest + cache-from: type=gha + cache-to: type=gha,mode=max + + deploy: + name: Deploy to Staging + runs-on: ubuntu-latest + needs: [build-and-push] + environment: staging + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Deploy notification + run: | + echo "🚀 Deployment to staging would happen here" + echo "Image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" + # Add actual deployment logic here (e.g., update Kubernetes, docker-compose, etc.) \ No newline at end of file