Handle issue with workspace already existing

This commit is contained in:
Khalim Conn-Kowlessar 2023-07-05 19:23:03 +01:00
parent e40970df5c
commit e3b68d56af

View file

@ -52,7 +52,9 @@ jobs:
run: cd infrastructure/terraform && terraform plan -var-file=${{ github.event.pull_request.base.ref }}.tfvars
- name: Terraform Workspace
run: cd infrastructure/terraform && terraform workspace new ${{ github.event.pull_request.base.ref }}
run: |
cd infrastructure/terraform
terraform workspace select ${{ github.event.pull_request.base.ref }} || terraform workspace new ${{ github.event.pull_request.base.ref }}
- name: Deploy to Dev
if: github.event.pull_request.base.ref == 'dev' && github.event.pull_request.merged == true