I have two workflows within the same project in gihub. The first workflow create and publishes a docker image on docker hub and is automatic on push. The second workflow which is manual should pull the docker image published in workflow 1 and deploy it on a cluster. As part of the first workflow I need to share a docker image tag from workflow 1 to workflow 2. How do I do that. I checked environment variables, but from what I have seen its localized to a workflow and you cannot share it between workflows.
You can make use of a reusable workflow using the workflow_call trigger and pass it the tag as an input
docs for reusable workflow: https://docs.github.com/en/actions/using-workflows/reusing-workflows.
If these workflows run at different times, you can store the tag string as an artifact and then reference it later.
docs for artifact: https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With