Skip to content

Commit

Permalink
👷 use gcs backend as tfstate store
Browse files Browse the repository at this point in the history
  • Loading branch information
Shion1305 committed Apr 14, 2024
1 parent ed2607b commit 8890a54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/deploy-terraform-apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions terraform/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8890a54

Please sign in to comment.