From 4742467222294c83549a6758fa469f2fcec8512a Mon Sep 17 00:00:00 2001 From: Martin Aceto Date: Thu, 29 Feb 2024 19:09:56 -0500 Subject: [PATCH] adding apply command --- .github/workflows/pipeline.yaml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index b0b6a8f..b58192b 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -60,5 +60,21 @@ jobs: - name: Terraform Plan id: plan - run: terraform plan -no-color -var="google_service_account_cloud_functions=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_CLOUD_FUNCTIONS }}" -var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}" -var="project_database=${{ env.PIPELINE_PROJECT_DATABASE_DEV }}" - continue-on-error: true \ No newline at end of file + run: | + terraform plan -no-color -var="google_service_account_cloud_functions=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_CLOUD_FUNCTIONS }}" \ + -var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}" \ + -var="project_database=${{ env.PIPELINE_PROJECT_DATABASE_DEV }}" + continue-on-error: true + + - name: Terraform Plan status + if: steps.plan.outcome == 'failure' + run: exit 1 + + - name: Terraform Apply + id: apply + run: | + terraform apply -var="google_service_account_cloud_functions=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_CLOUD_FUNCTIONS }}" \ + -var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}" \ + -var="project_database=${{ env.PIPELINE_PROJECT_DATABASE_DEV }}" \ + -auto-approve +