add tf workspace

This commit is contained in:
Jun-te Kim 2026-01-30 14:16:19 +00:00
parent 6594c3fa1e
commit afd1973499

View file

@ -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'