Update onix-gcp-terraform-deploy.yml

This commit is contained in:
AbhishekHS220
2025-06-04 11:05:09 +05:30
committed by GitHub
parent bc4f38b26f
commit 067030d58e

View File

@@ -30,13 +30,23 @@ jobs:
with:
terraform_version: 1.5.0
- name: Terraform Init with backend
- name: Create backend.tf and Terraform Init
working-directory: ./gerrit-repo/Terraform-CICD
env:
GCS_BUCKET: beckn-cicd-tf-state-bucket
run: |
terraform init \
-backend-config="bucket=beckn-cicd-tf-state-bucket" \
-backend-config="prefix=terraform/state" \
-backend-config="credentials=${{ github.workspace }}/gcp-key.json"
cat <<EOF > backend.tf
terraform {
backend "gcs" {
bucket = "${GCS_BUCKET}"
prefix = "terraform/state"
credentials = "${{ github.workspace }}/gcp-key.json"
}
}
EOF
terraform init
- name: Terraform Plan
working-directory: ./gerrit-repo/Terraform-CICD