Skip to content

Merge pull request #64 from 0-wook/develop #55

Merge pull request #64 from 0-wook/develop

Merge pull request #64 from 0-wook/develop #55

name: admin-server-deploy
on:
push:
branches: ["main"]
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: ECR 로그인
id: ecr-login
uses: jwalton/gh-ecr-login@v1
with:
access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
region: ap-northeast-2
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "corretto"
- name: Node 설치
uses: actions/setup-node@v3
with:
node-version: 16.14.0
- name: Docker 이미지 빌드
run: |
cd app/admin-server
./gradlew bootBuildImage --imageName=app
- name: ECR 업로드
uses: jwalton/gh-ecr-push@v1
with:
access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
region: ap-northeast-2
direction: push
local-image: app
image: automl-main-web:latest, automl-main-web:${GITHUB_SHA::7}
ecs:
needs: docker
runs-on: ubuntu-latest
steps:
- name: AWS CLI 설치
uses: unfor19/install-aws-cli-action@master
- name: AWS CLI 설정
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: ECS 배포
run: |
aws ecs update-service \
--cluster automl-cluster \
--service automl-service \
--task-definition automl-main-web-task-definition:18 \
--force-new-deployment