diff --git a/.github/workflows/deploy_terraform.yml b/.github/workflows/deploy_terraform.yml index 04272f6c..b57fb9c2 100644 --- a/.github/workflows/deploy_terraform.yml +++ b/.github/workflows/deploy_terraform.yml @@ -1,7 +1,7 @@ name: CI/CD Pipeline on: - pull_request: + push: branches: - main - dev @@ -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.head.ref == 'dev' && github.event.pull_request.merged == true + if: github.ref == 'refs/heads/dev' 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 == 'dev' && github.event.pull_request.head.ref == 'prod' && github.event.pull_request.merged == true + if: github.ref == 'refs/heads/prod' run: cd infrastructure/terraform && terraform apply -var-file=prod.tfvars -auto-approve env: name: prod