title: How to use output/artifact of one GitLab CI pipeline stage in subsequent stage?
body: <p>I have a pipeline that does 2 main things: 1) builds a static site using content from an external provider and 2) builds a docker container from that static site.</p>
  <p>At the moment, I have these steps in 2 stages, and the build stage produces an artifact</p>
  <pre><code>stages:
      - build
      - package
    
  build:
    stage: build
    image: node:12
    script:
      - npm ci
      - npm run build
    artifacts: 
      untracked: true
      paths: 
        - folder/for/project
        - folder/that/was/not/there/before/build/time
  
  package:
    stage: package
    image: docker:stable
    services:
      - docker:dind
    needs: 
      - build
    script:
      - export DOCKER_HOST=tcp://docker:2375/
      - docker build -t my-project . 
  </code></pre>
  <p>I can't get the package stage to see the built files though - the <code>docker build -t my-project</code> command will build a version where <code>folder/for/project</code> is present but <code>folder/that/was/not/there/before/build/time</code> is not. Downloading the artifact after the build step is completed does give me both folders, so clearly it is <em>exporting</em> the right stuff from that step and not <em>importing</em> it into the next.</p>
  <p>The CI log for the package stage does say that it's downloading <em>something</em> but I can't tell where it goes or how to access it (someID and tokenHere match values seen in the upload artifacts bit of the build step)</p>
  <pre><code>Downloading artifacts for build (someID)...
  Downloading artifacts from coordinator... ok        id=someID responseStatus=200 OK token=tokenHere
  </code></pre>
  <p>How do I pass these files from one stage in my pipeline to the next?</p>