Skip to content

Commit

Permalink
Update docker-ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dipak140 authored Dec 3, 2024
1 parent 0938704 commit af54ab3
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions .github/workflows/docker-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@ permissions:
packages: write

jobs:
build-and-push:
name: Build and Push Docker Image to AWS ECR
build:
runs-on: ubuntu-latest

steps:
# Step 1: Check out the repository
- name: Checkout Code
uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
Expand All @@ -30,21 +27,11 @@ jobs:
run: |
aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin 688351450096.dkr.ecr.ap-south-1.amazonaws.com
- name: Build the Docker image
run: docker build . --file Dockerfile --tag reconvin/reconvin-chat:latest

# Step 3: Set up Docker build environment
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Tag the Docker image
run: docker tag reconvin/reconvin-chat:latest 688351450096.dkr.ecr.ap-south-1.amazonaws.com/reconvin/reconvin-chat:latest

# Step 4: Build and Push Docker Image
- name: Build and Push Docker Image
run: |
# Define the ECR repository URL
REPO_URL=688351450096.dkr.ecr.ap-south-1.amazonaws.com
# Build and push the Docker image
docker build -t $REPO_URL:latest .
docker push $REPO_URL:latest
# Step 5: Confirm Success
- name: Confirm Deployment
run: echo "Docker image pushed successfully to ECR!"
- name: Push to Amazon ECR
run: docker push 688351450096.dkr.ecr.ap-south-1.amazonaws.com/reconvin/reconvin-chat:latest

0 comments on commit af54ab3

Please sign in to comment.