From fab6cf0d39083af5b36e60bef1493f99a6b96603 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Mon, 17 Jul 2023 11:19:55 +0100 Subject: [PATCH] change ordering of workspace switch --- .github/workflows/deploy_terraform.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy_terraform.yml b/.github/workflows/deploy_terraform.yml index ed0be93b..a7aef225 100644 --- a/.github/workflows/deploy_terraform.yml +++ b/.github/workflows/deploy_terraform.yml @@ -47,17 +47,17 @@ jobs: - name: Terraform Init run: cd infrastructure/terraform && terraform init - - name: Terraform Plan - run: | - BRANCH_NAME=$(echo "${{ github.ref }}" | sed -e "s/^refs\/heads\///") - cd infrastructure/terraform && terraform plan -var-file=${BRANCH_NAME}.tfvars - - 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=${BRANCH_NAME}.tfvars + - name: Deploy to Dev if: github.ref == 'refs/heads/dev' run: cd infrastructure/terraform && terraform apply -var-file=dev.tfvars -auto-approve