From 237e68746a948ce702ce92845b4b1aa18da1f7a7 Mon Sep 17 00:00:00 2001 From: Jonathan Flatt Date: Sun, 25 May 2025 16:55:43 -0500 Subject: [PATCH] Fix conditional Docker builds in deploy workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add path filtering to deploy.yml to match ci.yml pattern. This should prevent Docker builds when only documentation changes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/deploy.yml | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index da65420..51dbc82 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -51,12 +51,34 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} + # Check if Docker-related files changed + changes: + name: Detect Changes + runs-on: ubuntu-latest + outputs: + docker: ${{ steps.changes.outputs.docker }} + src: ${{ steps.changes.outputs.src }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: changes + with: + filters: | + docker: + - 'Dockerfile*' + - 'scripts/**' + - '.dockerignore' + - 'claude-config*' + src: + - 'src/**' + - 'package*.json' + build: name: Build Docker Image runs-on: [self-hosted, Linux, X64] - # Security: Only run on self-hosted for trusted sources - if: github.event.pull_request.head.repo.owner.login == 'intelligence-assist' || github.event_name != 'pull_request' - needs: test + # Security: Only run on self-hosted for trusted sources AND when files changed + if: (github.event.pull_request.head.repo.owner.login == 'intelligence-assist' || github.event_name != 'pull_request') && (needs.changes.outputs.docker == 'true' || needs.changes.outputs.src == 'true') + needs: [test, changes] outputs: image-tag: ${{ steps.meta.outputs.tags }}