- Defining repository-level variables for namespace, replicas, and image
- Installing and configuring the
cschleiden/replace-tokens@v1action - Dynamically fetching the Ingress controller’s external IP
- Applying placeholder replacement in
kubernetes/development/*.yaml - Verifying the transformed manifests before deployment
Placeholder tokens in your manifests
Underkubernetes/development/, manifests contain tokens like {_NAMESPACE_}, {_REPLICAS_}, {_IMAGE_}, and {_INGRESS_IP_}:
1. Define repository variables
Navigate to Settings > Secrets and variables > Actions in your GitHub repository. Here you can add both non-secret variables and secrets.
Use Variables for non-sensitive configuration (e.g.,
NAMESPACE, REPLICAS) and Secrets for credentials (KUBECONFIG, DOCKERHUB_PASSWORD).


2. Choose a token-replacement action
From the GitHub Marketplace, install cschleiden/replace-tokens@v1. This action will scan files and replace tokens based on your specified prefix and suffix.
3. Fetch the Ingress IP dynamically
Hard-coding the external IP limits flexibility. Instead, retrieve it at runtime usingkubectl and store it in GITHUB_ENV:
4. Complete GitHub Actions workflow
Below is a full example workflow that ties everything together:5. Outcome
After the workflow completes:namespacewill be set todevelopmentreplicasupdated to2imageresolved as<your-dockerhub-username>/solar-system:<commit-sha>- Ingress host entries generated with the actual load balancer IP
kubernetes/production/) by adjusting repository variables and glob patterns in the workflow.