drm_hwcomposer: CI: Only run build-docker when necessary

When building the docker image via docker in docker, we sometimes
see system errors such as:

*** WARNING: Service runner-zcexkv2-project-23176-concurrent-0-14607a9f5e2c806b-docker-0 probably didn't start properly.
Health check error:
create service container: Error response from daemon: bad parameter: link is not supported (services.go:208:0s)
Service container logs:
*********

This hinders all merge requests.

Limit the build-docker job to be only ran when .ci/Dockerfile is modified.

Link: https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/-/issues/96
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index da052c3..ea15c9a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -27,6 +27,13 @@
     - docker push $DOCKER_IMAGE_TAG
   after_script:
     - docker logout
+  rules:
+    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
+      changes:
+      - .ci/Dockerfile
+    - if: $CI_PIPELINE_SOURCE == 'push'
+      changes:
+      - .ci/Dockerfile
 
 build:
   stage: build