changed trigger condition

This commit is contained in:
Khalim Conn-Kowlessar 2023-07-05 19:40:26 +01:00
parent 695672999a
commit 69362570b8

View file

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