- This will be used to clone base repo.
- Create
Repository Secret
calledGH_TOKEN
and add your Github PAT as value for the secret.
- This will be per customer where we can restrict branches and create secrets for that customer.
- In below screenshot,
customer1
branch is only allowed to deploy tocustomer1
env which usescustomer1
google credentials.
- This will be used to auth to gcp.
- In your customer env, Create
Environment Secret
calledGOOGLE_CREDENTIALS
and add your service account key json as value for the secret.
- Github action workflow file : https://github.com/SunnyOswal/tf-gcp-customer/blob/main/.github/workflows/workflow.yml
- Create a local branch (use same name as the environment name used above in prerequistes)
- Create provider.tf, backend.tf and
Customer.tfvars
(use same name , do not change) - Commit and push local branch to remote and it will trigger the terraform pipeline.