Skip to content

Merge pull request #2 from imrishuroy/ft/docker #1

Merge pull request #2 from imrishuroy/ft/docker

Merge pull request #2 from imrishuroy/ft/docker #1

Workflow file for this run

name: Deploy to production
on:
push:
branches: [ main ]
jobs:
build:
name: Build image
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4 # More information on this action can be found below in the 'AWS Credentials' section
with:
role-to-assume: arn:aws:iam::963933939017:user/github_ci
aws-region: ap-south-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build, tag, and push docker image to Amazon ECR
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: simplebank
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG .
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG