Merge pull request #6 from Hestia-Homes/main

Handle issue with workspace already existing
This commit is contained in:
KhalimCK 2023-07-05 19:23:23 +01:00 committed by GitHub
commit 12d788fc1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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