Skip to content

Commit 3c95266

Browse files
committed
feature/[hackaton]: enable trigger pull_request in workflow deploy-project
1 parent 335b408 commit 3c95266

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

.github/workflows/deploy-project.yaml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
name: 'Deploy Resources in Production'
22

3-
#on:
4-
# pull_request:
5-
# types:
6-
# - closed
7-
# branches:
8-
# - main
9-
103
on:
11-
push:
4+
pull_request:
5+
types:
6+
- closed
127
branches:
138
- main
149

@@ -19,7 +14,7 @@ permissions:
1914

2015
jobs:
2116
create-ecr:
22-
# if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
17+
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
2318
uses: team-tech-challenge/terraform-reusable-actions/.github/workflows/create-elastic-container-registry.yml@main
2419
secrets:
2520
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
@@ -34,7 +29,7 @@ jobs:
3429

3530
build-push:
3631
needs: create-ecr
37-
# if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
32+
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
3833
uses: team-tech-challenge/terraform-reusable-actions/.github/workflows/build-image-and-push.yml@main
3934
secrets:
4035
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -45,7 +40,7 @@ jobs:
4540

4641
trivy-scan:
4742
needs: build-push
48-
# if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
43+
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
4944
uses: team-tech-challenge/terraform-reusable-actions/.github/workflows/trivy-scan.yml@main
5045
secrets:
5146
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -55,7 +50,7 @@ jobs:
5550

5651
deploy:
5752
needs: trivy-scan
58-
# if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
53+
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
5954
uses: team-tech-challenge/terraform-reusable-actions/.github/workflows/create-lambda-aws.yml@main
6055
with:
6156
environment: 'production'

0 commit comments

Comments
 (0)