change branch requirements on dev and prod deploy statements

This commit is contained in:
Khalim Conn-Kowlessar 2023-07-05 19:34:25 +01:00
parent d7b24ccdd1
commit 112c7bedbb

View file

@ -57,7 +57,7 @@ jobs:
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
if: github.event.pull_request.base.ref == 'main' && github.event.pull_request.head.ref == 'dev' && github.event.pull_request.merged == true
run: cd infrastructure/terraform && terraform apply -var-file=dev.tfvars -auto-approve
env:
name: dev
@ -72,7 +72,7 @@ jobs:
AWS_PROFILE: "ProdAdmin"
- name: Deploy to Prod
if: github.event.pull_request.base.ref == 'prod' && github.event.pull_request.merged == true
if: github.event.pull_request.base.ref == 'dev' && github.event.pull_request.head.ref == 'prod' && github.event.pull_request.merged == true
run: cd infrastructure/terraform && terraform apply -var-file=prod.tfvars -auto-approve
env:
name: prod