A workflow involves creating a Docker image and then pushing it to a registry. But how can we guarantee the image built in one step is accessible for pushing in another step?
-
Add both build & push steps within the same job. - This option should be correct as we can access the docker image is possible if they are in same job as they use same machine. I could build the image in one step and access it in next step.
-
Use artifacts to upload the image and download it in the subsequent - This option is given as correct answer but I don’t see option to upload docker image using upload-artifact. We could use packages with GitHub registry, but artifacts upload can’t be used here for docker images.