From afd19734992e2e272302848ef382bb36c8486c2e Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Fri, 30 Jan 2026 14:16:19 +0000 Subject: [PATCH] add tf workspace --- .github/workflows/deploy_terraform.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy_terraform.yml b/.github/workflows/deploy_terraform.yml index 5bc02440..16ca1068 100644 --- a/.github/workflows/deploy_terraform.yml +++ b/.github/workflows/deploy_terraform.yml @@ -46,16 +46,16 @@ jobs: - name: Terraform Init run: cd infrastructure/terraform && terraform init - # - name: Terraform Workspace - # run: | - # BRANCH_NAME=$(echo "${{ github.ref }}" | sed -e "s/^refs\/heads\///") - # cd infrastructure/terraform - # terraform workspace select ${BRANCH_NAME} || terraform workspace new ${BRANCH_NAME} + - name: Terraform Workspace + run: | + BRANCH_NAME=$(echo "${{ github.ref }}" | sed -e "s/^refs\/heads\///") + cd infrastructure/terraform + terraform workspace select ${BRANCH_NAME} || terraform workspace new ${BRANCH_NAME} - name: Terraform Plan run: | BRANCH_NAME=$(echo "${{ github.ref }}" | sed -e "s/^refs\/heads\///") - cd infrastructure/terraform && terraform plan -var-file=dev.tfvars + cd infrastructure/terraform && terraform plan -var-file=${BRANCH_NAME}.tfvars # - name: Deploy to Dev # if: github.ref == 'refs/heads/dev'