Deploy compiled assets from previously run job in same workflow

I seem to have run into a wall with CircleCI and I’m frustrated because I’ve read the docs over and over again and it is completely unclear how different Jobs in the same Workflow access shared data, such as binaries compiled in the initial job, and then deployed in the final job.

Example UseCase:

Job 1 checks out code, tests code, and builds binaries from the tested source code.

Job 2 takes the compiled binaries and deploys them

Problem: How on earth does Job 2 access the compiled binaries??

From reading the docs and looking at the examples, it appears that save_cache and restore_cache is used for this. However, in my use case, Job 1 is running inside a Docker container and Job 2 is running on a machine; the paths to the binaries are different. In short, I have no clue how to access the binaries once restore_cache is called from Job 2.

Am I missing something here? How does one share data between Jobs in the same Workflow?

1 Like

I must have been running into a race condition, with my two workflows running at the same time. I added a “requires: build” and that seems to have fixed it. I also wasn’t adding a unique timestamp to the saved cache so it kept grabbing the same one.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.