Merge pull request #37 from Hestia-Homes/main

change ordering of workspace switch
This commit is contained in:
KhalimCK 2023-07-17 11:20:12 +01:00 committed by GitHub
commit eb4f19a69a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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