Skip to content

Commit

Permalink
[#3] feat: Add ECR push to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
FacerAin authored Jan 30, 2024
1 parent 4c79b72 commit ee44fbe
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Deploy to ECR

on:
push:
tags:
- v*
workflow_dispatch:

jobs:
build:
name: Build Image
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set RELEASE_VERSION
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
run: |
docker build -t dnd-10th-2-backend-springboot .
docker tag dnd-10th-2-backend-springboot:${{ env.RELEASE_VERSION }} public.ecr.aws/g8f7f0e2/dnd-10th-2-backend:${{ env.RELEASE_VERSION }}
docker push public.ecr.aws/g8f7f0e2/dnd-10th-2-backend:${{ env.RELEASE_VERSION }}

0 comments on commit ee44fbe

Please sign in to comment.