
Why Reusable Workflows?
By extracting common deployment logic into reusable workflows, the team will be able to:- Maintain a single source of truth for Kubernetes deployments
- Ensure consistency across Node.js, Java, and Python applications
- Simplify updates and reduce duplication in each repository
Reusable workflows allow you to centralize steps like building Docker images, pushing to a registry, and applying manifests to your cluster. You can invoke them from any repository with minimal configuration.
Reuse Strategy Overview
| Language | Deployment Tooling | Workflow File Path |
|---|---|---|
| Node.js | Helm | .github/workflows/deploy-nodejs.yaml |
| Java | Kubernetes CLI | .github/workflows/deploy-java.yaml |
| Python | Kustomize | .github/workflows/deploy-python.yaml |
Next Steps
-
Author the Reusable Workflow
- Define inputs (e.g.,
cluster_name,namespace,image_tag). - Encapsulate build, push, and deploy steps in a single workflow file under the
.github/workflows/directory of your common workflow repository.
- Define inputs (e.g.,
-
Consume the Reusable Workflow
- In each service repository, create a lightweight workflow that calls the central workflow.
- Pass environment-specific parameters to customize deployments per language.
-
Validate and Iterate
- Test deployments in a staging environment first.
- Monitor logs and update the central workflow as new requirements emerge.
Ensure that each consuming repository has the necessary GitHub secrets configured (e.g.,
KUBE_CONFIG_DATA, DOCKER_REGISTRY_TOKEN) before invoking the reusable workflow.