Update onix-gcp-terraform-deploy.yml
This commit is contained in:
20
.github/workflows/onix-gcp-terraform-deploy.yml
vendored
20
.github/workflows/onix-gcp-terraform-deploy.yml
vendored
@@ -30,13 +30,23 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
terraform_version: 1.5.0
|
terraform_version: 1.5.0
|
||||||
|
|
||||||
- name: Terraform Init with backend
|
- name: Create backend.tf and Terraform Init
|
||||||
working-directory: ./gerrit-repo/Terraform-CICD
|
working-directory: ./gerrit-repo/Terraform-CICD
|
||||||
|
env:
|
||||||
|
GCS_BUCKET: beckn-cicd-tf-state-bucket
|
||||||
run: |
|
run: |
|
||||||
terraform init \
|
cat <<EOF > backend.tf
|
||||||
-backend-config="bucket=beckn-cicd-tf-state-bucket" \
|
terraform {
|
||||||
-backend-config="prefix=terraform/state" \
|
backend "gcs" {
|
||||||
-backend-config="credentials=${{ github.workspace }}/gcp-key.json"
|
bucket = "${GCS_BUCKET}"
|
||||||
|
prefix = "terraform/state"
|
||||||
|
credentials = "${{ github.workspace }}/gcp-key.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
terraform init
|
||||||
|
|
||||||
|
|
||||||
- name: Terraform Plan
|
- name: Terraform Plan
|
||||||
working-directory: ./gerrit-repo/Terraform-CICD
|
working-directory: ./gerrit-repo/Terraform-CICD
|
||||||
|
|||||||
Reference in New Issue
Block a user