Update onix-gcp-terraform-deploy.yml
This commit is contained in:
19
.github/workflows/onix-gcp-terraform-deploy.yml
vendored
19
.github/workflows/onix-gcp-terraform-deploy.yml
vendored
@@ -30,6 +30,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
terraform_version: 1.5.0
|
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
|
- name: Create backend.tf and Terraform Init
|
||||||
working-directory: ./gerrit-repo/Terraform-CICD
|
working-directory: ./gerrit-repo/Terraform-CICD
|
||||||
env:
|
env:
|
||||||
@@ -47,19 +53,6 @@ jobs:
|
|||||||
|
|
||||||
terraform init
|
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
|
- name: Terraform Plan
|
||||||
working-directory: ./gerrit-repo/Terraform-CICD
|
working-directory: ./gerrit-repo/Terraform-CICD
|
||||||
run: terraform plan
|
run: terraform plan
|
||||||
|
|||||||
Reference in New Issue
Block a user