Skip to content

Commit

Permalink
Update new build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
imrkgofficial authored Nov 27, 2024
1 parent 42b0271 commit d276f0d
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,33 @@ jobs:
login-to-aws:
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v4
- name: Code Checkout
uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.SECRET_ACCESS_KEY }}
aws-region: ap-south-1
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.SECRET_ACCESS_KEY }}
aws-region: ap-south-1

build-and-push-ecr:
runs-on: ubuntu-latest
needs: login-to-aws

steps:
- name: Code Checkout
uses: actions/checkout@v4
- name: Code Checkout
uses: actions/checkout@v4
- name: Login to AWS ECR
run: |
echo ${{ secrets.PVT_ECR_PASSWORD }} | docker login --username AWS --password-stdin 637423205071.dkr.ecr.ap-south-1.amazonaws.com
env:
AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ap-south-1

- name: Login to AWS ECR
run: |
echo ${{ secrets.PVT_ECR_PASSWORD }} | docker login --username AWS --password-stdin 637423205071.dkr.ecr.ap-south-1.amazonaws.com
env:
AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ap-south-1

- name: Build and Push Image
run: |
docker build -t bank .
docker tag bank:latest 637423205071.dkr.ecr.ap-south-1.amazonaws.com/bank:latest
docker push 637423205071.dkr.ecr.ap-south-1.amazonaws.com/bank:latest
- name: Build and Push Image
run: |
docker build -t bank .
docker tag bank:latest 637423205071.dkr.ecr.ap-south-1.amazonaws.com/bank:latest
docker push 637423205071.dkr.ecr.ap-south-1.amazonaws.com/bank:latest

0 comments on commit d276f0d

Please sign in to comment.