From bdcc8989f76a440459e8d5c77f034cec2e49af44 Mon Sep 17 00:00:00 2001 From: ShiKhu Date: Wed, 10 Nov 2021 15:45:38 +0100 Subject: [PATCH] feat (github workflow): backend service rebuild on pkg dependency change --- .github/workflows/workers.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workers.yaml b/.github/workflows/workers.yaml index 37d87bfb6..3b1d21491 100644 --- a/.github/workflows/workers.yaml +++ b/.github/workflows/workers.yaml @@ -47,7 +47,15 @@ jobs: # # Getting the images to build # - git diff --name-only HEAD HEAD~1 | grep backend/services | grep -vE ^ee/ | cut -d '/' -f3 | uniq > backend/images_to_build.txt + + { + git diff --name-only | grep backend/services | grep -vE ^ee/ | cut -d '/' -f3 + + git diff --name-only | grep backend/pkg | grep -vE ^ee/ | cut -d '/' -f3 | uniq | while read -r pkg_name ; do + grep -rl "pkg/$pkg_name" backend/services | cut -d '/' -f3 + done + } | uniq > backend/images_to_build.txt + [[ $(cat backend/images_to_build.txt) != "" ]] || (echo "Nothing to build here"; exit 0) # # Pushing image to registry