Tidy up docker build ci & support nightly builds

What does this MR do and why?

This merge request consolidates and improves the Docker build jobs in the GitLab CI pipeline by:

  1. Merging the docker-build-dev and docker-build-prod jobs into a single docker-build job adjusting based on the environment (dev, prod, or nightly scheduled builds).
  2. Adding logic to omit caching for nightly scheduled builds to ensure fresh images are generated.
  3. Simplifying and improving maintainability by reducing duplication in the CI configuration.

Key Changes:

  • A single docker-build job now handles:
    • Development builds triggered on the dev branch.
    • Production builds triggered on the default branch (master).
    • Scheduled nightly builds on the default branch.
  • Conditional caching:
    • Regular builds use the cache to reduce build time.
    • Nightly builds skip the cache for fresh image generation.
  • Ensures that all build tags (e.g., :latest, version-specific tags, :nightly) are properly handled based on the environment and trigger type.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

  • Have you checked this doesn't interfere/conflict/duplicate someone else’s work?
  • Have you fully tested your changes?
  • Have you resolved any lint issues?
  • N/A Have you assigned a reviewer?
  • Have you applied correct labels?

Merge request reports

Loading