Skip to content

Feat/alpha env

Feat/alpha env #1

name: Build Alpha Image
on:
# push:
pull_request:
branches: [ develop ]
paths: backend/**
jobs:
build:
defaults:
run:
working-directory: backend
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::791335373803:role/AWSPushImageToECR
aws-region: ap-northeast-2
- name: Amazon ECR "Login" Action for GitHub Actions
uses: aws-actions/[email protected]
- name: Build Image
run: docker build .
- name: push ECR
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: my-ecr-repo
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG .
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG