Optimize CI by caching dep

Hello,

we are successfully using gitlab for our project. It’s a pleasure to use such a fantastic tool.
In addition, we use gitlab CI with almost no problems. Indeed, I have a question. One of our jobs (which creates a flatpak package) takes a long time due to dependency building (opencv). I would like to know if it was possible to optimize it. It’s a shame to use a machine for 90 minutes when only 10 minutes are really needed. I’m not really comfortable with CIs (this one has not been written by me) so this is why I’m asking to you. Maybe someone knows the perfect solution :).

The job is:

flatpak:
  # Update the image URL whenever the runtime version in the flatpak manifest is changed
  image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:3.36'
  stage: 'siril'
  variables:
    MANIFEST_PATH: "build/flatpak/org.free_astro.siril.json"
    FLATPAK_MODULE: "siril"
    APP_ID: "org.free_astro.siril"
    RUNTIME_REPO: "https://flathub.org/repo/flathub.flatpakrepo"
    BUNDLE: "org.free_astro.siril.flatpak"
    GIT_SUBMODULE_STRATEGY: recursive
  script:
    - flatpak-builder --stop-at=${FLATPAK_MODULE} flatpak_app ${MANIFEST_PATH} 1>/dev/null
    # Make sure to keep this in sync with the Flatpak manifest, all arguments
    # are passed except the config-args because we build it ourselves
    - flatpak build flatpak_app ./autogen.sh --prefix=/app
    - flatpak build flatpak_app make
    - flatpak build flatpak_app make install
    - flatpak-builder --finish-only --repo=repo ${BRANCH:+--default-branch=$BRANCH} flatpak_app ${MANIFEST_PATH}
    # TODO: Run automatic tests inside the Flatpak env 
    # - >
    #   xvfb-run -a -s "-screen 0 1024x768x24"
    #   flatpak build
    #   --env=LANG=C.UTF-8
    #   --env=NO_AT_BRIDGE=1
    #   ${TEST_BUILD_ARGS}
    #   flatpak_app
    #   dbus-run-session
    #   meson test -C _build --no-stdsplit --print-errorlogs ${TEST_RUN_ARGS}

    # Generate a Flatpak bundle
    - flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APP_ID} ${BRANCH}
  artifacts:
    name: 'Flatpak artifacts'
    expose_as: 'Get Flatpak bundle here'
    when: 'always'
    paths:
      - "${BUNDLE}"
      - 'repo/'
    expire_in: 1 week
  cache:
    key: "$CI_JOB_NAME"
    paths:
      - '.flatpak-builder/downloads'
      - '.flatpak-builder/git'
  needs: []

And the output is: