# Generated by `sfdt ci init --provider gitlab --type deploy`.
# Merge this job into your .gitlab-ci.yml. Runs a code quality scan (advisory)
# and a smart delta check-only deploy on merge requests (delta computed against
# the MR target branch). Generate the matching real-deploy job with --type release.
#
# The quality scan expects a committed .sfdt/config.json (run `sfdt init`).
#
# Required CI/CD variables (Settings > CI/CD > Variables, masked):
{{authSecretsDoc}}
sfdt-smart-deploy:
  image: {{image}}
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
  variables:
    GIT_DEPTH: 0
  script:
    {{cliSetup}}
    {{authSteps}}
    {{qualitySteps}}
    - {{cli}} deploy --smart --org {{org}} --delta-base "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" --dry-run
