I was working on a parallel workflow for some React deployments to separate out the build and deploy phases like this:
[ build staging ] => [deploy staging] => [approval] => [deploy prod] [ build prod ]
using workspaces to store the built app between the corresponding build and deploy steps. This works great in a case where there’s only a single job in the workflow.
I had slightly misunderstood the description of how concurrent workflows and workspaces interacted in:
So, I got the error:
Concurrent upstream jobs persisted the same file(s), which now totally makes sense to me.
My question is: is there any way to get the behavior I want with workspaces (assuming the built directory is always the same on the source side, e.g.,
build/)? Is there a way to use a unique path with
persist_to_workspace without actually renaming the directory, or would I need to do something like
mv build build_prod and persist that? Can I use env vars in the path name if I go that route?
I am thinking that using artifacts instead would not really be the right use case for this purpose?