Feat/alpha env #3
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: Build Alpha Image | |
on: | |
# push: | |
pull_request: | |
branches: [ develop ] | |
paths: backend/** | |
permissions: | |
id-token: write | |
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 |