How to execute a job based on a variable modified in a previous job

How to execute a job based on a variable modified in a previous job

hello community, having the following code, how can I run ‘deploy-job’ based on the RUN_DEPLOY value assigned in the job ‘build-job’?

variables:
  RUN_DEPLOY: "false"

stages:
  - build
  - deploy

build-job:
  stage: build
  script:
    - export RUN_DEPLOY="true"
  artifacts:
    reports:
        dotenv: build.env

deploy-job:
  stage: deploy
  script:
    - echo "Running deploy..."
  rules:
    - if: $RUN_DEPLOY == "true"
      when: manual
  dependencies:
    - build-job