Skip to content

Merge pull request #8 from dzniel/dev #3

Merge pull request #8 from dzniel/dev

Merge pull request #8 from dzniel/dev #3

Workflow file for this run

name: Deploy to production
on:
push:
branches: [ "master" ]
jobs:
build:
permissions:
id-token: write
contents: read
name: Build image
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::612466081150:role/github-actions-role
aws-region: ap-southeast-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push docker image to Amazon ECR
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: simple-bank
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG