Today I Learned

Persisting files between jobs in CircleCI's worklow

When you have a file or files that you want to persist between jobs in Workflow you can add the step persist_to_workspace in the job that creates the files.

For example:

Assuming that you have a job that builds JS project and creates a zip under builds/ in the workdir directory you can add step:

      - persist_to_workspace:
          root: .
          paths:
            - builds/*

And in the followup jobs you need to call

      - attach_workspace:
          at: ./

to have access to those files. The files will be accessible under ./builds directory.

Docs:

https://circleci.com/docs/2.0/configuration-reference/#persist_to_workspace https://circleci.com/docs/2.0/configuration-reference/#attach_workspace