Skip to content

Commit 594a94f

Browse files
committed
change workflow
1 parent 948d482 commit 594a94f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/ec2-pipeline.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,15 @@ jobs:
6868
hostname
6969
whoami
7070
pwd
71-
apt-get update
72-
apt-get install awscli
71+
# Install the AWS CLI if not already available
72+
if ! command -v aws &> /dev/null; then
73+
apt-get update
74+
apt-get install -y awscli
75+
fi
76+
77+
# Get ECR login command and execute it
78+
$(aws ecr get-login --no-include-email --region $AWS_REGION)
79+
aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin 306093656765.dkr.ecr.ap-south-1.amazonaws.com
7380

7481
- name: Set up AWS CLI credentials
7582
env:

0 commit comments

Comments
 (0)