From 8890a547b3c2b91f5c8c8904dc14fdf149b84027 Mon Sep 17 00:00:00 2001 From: Shion Ichikawa Date: Mon, 15 Apr 2024 04:17:56 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20use=20gcs=20backend=20as=20tfsta?= =?UTF-8?q?te=20store?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-terraform-apply.yaml | 17 ----------------- terraform/provider.tf | 4 ++-- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/.github/workflows/deploy-terraform-apply.yaml b/.github/workflows/deploy-terraform-apply.yaml index 56e326b..339ea16 100644 --- a/.github/workflows/deploy-terraform-apply.yaml +++ b/.github/workflows/deploy-terraform-apply.yaml @@ -60,20 +60,3 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: tfcmt apply -- terraform apply -auto-approve - - - name: Check diff - id: check_diff - run: git diff --exit-code ./terraform/state - continue-on-error: true - - - name: exit if no diff - if: steps.check_diff.outcome == 'failure' - run: exit 0 - - - name: Commit and push - run: | - git config --global user.email "action@github.com" - git config --global user.name "GitHub Action" - git add terraform/state - git commit -m "🧱 Update terraform state" - git push origin main diff --git a/terraform/provider.tf b/terraform/provider.tf index 79df78c..e611152 100644 --- a/terraform/provider.tf +++ b/terraform/provider.tf @@ -6,8 +6,8 @@ provider "google" { terraform { required_version = ">= 1.8.0" - backend "local" { - path = "state/terraform.tfstate" + backend "gcs" { + bucket = "lumos-profile-management-tf-state" } required_providers {