feat (github workflow): backend service rebuild on pkg dependency change

This commit is contained in:
ShiKhu 2021-11-10 15:45:38 +01:00
parent aa6b88ea76
commit bdcc8989f7

View file

@ -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