How do I configure an optional job in my pipeline?

I want to have an optional part in my pipeline.

  1. stage build - mandatory, this stage should decide if the build passed or failed and be used for if a merge request can be merged.

  2. stage docker - manual triggered optional step to build a docker image for the following step

  3. stage deploy - automatic step executed after the “docker” stage was executed successfully

how do I set up such a pipeline? I tried a lot of different configuration combinations. But either the pipeline stayed in-state “running” or in-state “blocked”, which prevents me to merge the branch without running the manual step.

There are a lot of topics about optional steps, but there is no answer nor are there any resolved tickets. Optional steps are not new. topics exists already for several years. I’m I correct that there is still no solution to this problem?