Update Dockerfile #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CD Pipeline | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 # Replace with your AWS region | |
- name: Login to Amazon ECR | |
run: aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 471112786669.dkr.ecr.us-east-1.amazonaws.com | |
- name: Build Docker image | |
run: docker build -t socialites-app . | |
- name: Tag Docker image | |
run: docker tag socialites-app:latest 471112786669.dkr.ecr.us-east-1.amazonaws.com/socialites-app:latest | |
- name: Push Docker image to Amazon ECR | |
run: docker push 471112786669.dkr.ecr.us-east-1.amazonaws.com/socialites-app:latest |