Fix Docker build rules to use $CI_DEFAULT_BRANCH
Summary
The Docker image build rules were broken for the develop branch:
The bug: Rules checked for main branch, but this repo uses develop as the default branch.
- Rule 1 checked
$CI_COMMIT_BRANCH == "main"- never matched - Rule 2 applied to develop (since
develop !~ /^main$/), but usedcompare_to: refs/heads/develop - When ON develop, comparing to develop shows zero changes, so builds never ran
The fix:
- Replace hardcoded
"main"with$CI_DEFAULT_BRANCH - Replace regex
!~ /^main$/with!= $CI_DEFAULT_BRANCH
Also adds allow_failure: true to buildkit_cache_cleanup since it's a maintenance task that shouldn't block pipelines.
Impact
This fixes the issue where Docker images weren't rebuilt on develop even when their source files changed.