⚡ 공용 컴포넌트 리팩토링 (#64) #45
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: Continuous Deployment | |
on: | |
push: | |
branches: ['main'] | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
type: choice | |
options: | |
- info | |
- warning | |
- debug | |
tags: | |
description: 'Test scenario tags' | |
required: false | |
type: boolean | |
environment: | |
description: 'Environment to run tests against' | |
type: environment | |
required: false | |
permissions: | |
contents: read | |
jobs: | |
deployment: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout pull request | |
uses: actions/checkout@v4 | |
- name: Reuse setup action | |
uses: ./.github/actions/setup | |
# 7. Yarn 빌드 파일 생성 | |
- name: Yarn build | |
run: yarn build | |
# 8. Docker 이미지 build 및 push | |
- name: Docker build and push | |
run: | | |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | |
docker build -t pennyway/pennyway-webview . | |
docker push pennyway/pennyway-webview | |
# 9. AWS SSM을 통한 Run-Command | |
- name: AWS SSM Send-Command | |
uses: peterkimzz/aws-ssm-send-command@master | |
id: ssm | |
with: | |
aws-region: ${{ secrets.AWS_REGION }} | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
instance-ids: ${{ secrets.AWS_DEV_INSTANCE_ID }} | |
working-directory: /home/ubuntu | |
command: | | |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | |
docker stop webview | |
docker system prune -a -f | |
docker pull pennyway/pennyway-webview | |
docker run --name "webview" -d -p 3000:3000 pennyway/pennyway-webview |