Update onix-gcp-terraform-deploy.yml

This commit is contained in:
AbhishekHS220
2025-06-04 11:15:11 +05:30
committed by GitHub
parent bd3a998eb9
commit 8792a3cbdd

View File

@@ -30,6 +30,12 @@ jobs:
with:
terraform_version: 1.5.0
- name: Authenticate to Google Cloud
run: echo "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON }}" > gcp-key.json
- name: Export GCP Credentials to Terraform
run: echo "GOOGLE_APPLICATION_CREDENTIALS=$GITHUB_WORKSPACE/gcp-key.json" >> $GITHUB_ENV
- name: Create backend.tf and Terraform Init
working-directory: ./gerrit-repo/Terraform-CICD
env:
@@ -46,19 +52,6 @@ jobs:
EOF
terraform init
- name: Create provider.tf with credentials
working-directory: ./gerrit-repo/Terraform-CICD
run: |
cat <<EOF > provider.tf
provider "google" {
credentials = "${{ github.workspace }}/gcp-key.json"
project = "trusty-relic-370809"
region = "asia-south1"
}
EOF
- name: Terraform Plan
working-directory: ./gerrit-repo/Terraform-CICD