title: GitLab-CI job fail when having a dependency on a previous manual job
body: <h3>Situation</h3>
  
  <p>Consider the following <code>.gitlab-ci.yml</code> example:</p>
  
  <pre><code>build:
      stage: build
      script: echo "Building..."
  
  build-doc:
      stage: build
      when: manual
      script: 
          - echo "Building doc..."
          - echo "build result" &gt; output.txt
      artifacts:
          name: "%CI_BUILD_NAME%_%CI_BUILD_ID%"
          expire_in: 1 week
          paths:
              - "output.txt"
  
  deploy-doc:
      stage: deploy
      only:
          - master
      dependencies:
          - build-doc
      script: 
          - echo "Deploying doc..."
          - type output.txt
  </code></pre>
  
  <h3>Result</h3>
  
  <p>The result of this pipeline on the <code>master</code> branch is:</p>
  
  <p><a href="https://i.stack.imgur.com/qoYcN.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qoYcN.png" alt="gitlab-ci-result"></a></p>
  
  <p>The log of the <code>deploy-doc</code> job says:</p>
  
  <pre><code>$ echo "Deploying doc..."
  "Deploying doc..."
  $ type output.txt
  The system cannot find the file specified.
  ERROR: Build failed: exit status 1
  </code></pre>
  
  <h3>Conclusion</h3>
  
  <p>Even if the <code>deploy-doc</code> has explicitly a dependency on the manual <code>build-doc</code> job artifact, the <code>build-doc</code> don't get triggered leading to the a fail of the <code>deploy-doc</code> job.</p>
  
  <h3>Question</h3>
  
  <p>How can I implement this behaviour correctly? Namely, having a manual job which get triggered when an <em>automatic</em> job has dependencies on him?</p>
  
  <h3>Context</h3>
  
  <p>I only want to automatically build <strong>and</strong> deploy the doc on the <code>master</code> branch, the other branches can only build the doc manually to download the generated doc.</p>
  
  <h3>Solution</h3>
  
  <p>In addendum to the accepted answer, see my own answer <a href="https://stackoverflow.com/a/42760945/2501769">below</a>.</p>