dev-deploy and prod-deploy, extract them into a single reusable workflow.
Why Avoid Duplication?
A typical “Solar System Workflow” might look like this:dev-deploy and prod-deploy quickly becomes error-prone. Use reusable workflows to centralize your logic.
See the official documentation for an overview of reusing workflows in GitHub Actions.

1. Create the Reusable Workflow
- File location:
.github/workflows/reuse-deployment.yml - Trigger: replace
on: workflow_dispatchwithon: workflow_call. - Inputs: declare
kubeconfigas a required string.
Full Workflow Definition
2. Call the Reusable Workflow
Replace the inlinedev-deploy and prod-deploy jobs in your main pipeline:
| Original Job | Reusable Workflow Call |
|---|---|
dev-deploy | uses: ./.github/workflows/reuse-deployment.yml |
prod-deploy | uses: ./.github/workflows/reuse-deployment.yml |

3. Troubleshoot Missing Inputs
If your pipeline fails with:kubeconfig input.

Always pass all required inputs when calling a reusable workflow: