Skip to content

Commit cd4b9d9

Browse files
authored
Add dependency on BuildandPush
1 parent 3d01332 commit cd4b9d9

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

.github/workflows/DeployEC2.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
name: Deploy to EC2
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
workflow_run:
5+
workflows: ["Build and Push All Images"]
6+
types:
7+
- completed
78

89
jobs:
910
deploy:
11+
if: ${{ github.event.workflow_run.conclusion == 'success' }} # Run only when build is passing on BuildandPush workflow
1012
name: Deploy to Amazon EC2
1113
runs-on: ubuntu-latest
12-
14+
1315
steps:
1416
- name: Checkout repo
1517
uses: actions/checkout@v3

0 commit comments

Comments
 (0)