Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix]workflows 수정 #36

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/dev_deply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ jobs:
username: ubuntu
key: ${{ secrets.EC2_PRIVATE_KEY}}
script: |
# Docker 이미지 pull
sudo docker pull ${{ secrets.DOCKERHUB_USERNAME }}/bill-api:latest

# 기존 컨테이너 중지 및 제거
if [ $(sudo docker ps -a -q -f name=bill-api) ]; then
sudo docker stop bill-api
sudo docker rm bill-api
fi

# Docker 이미지 태그 설정 및 실행
sudo docker tag ${{ secrets.DOCKERHUB_USERNAME }}/bill-api:latest bill-api
sudo docker run --name bill-api -d -p 80:8080 \
-e SPRING_DATASOURCE_URL="${SPRING_DATASOURCE_URL}" \
Expand All @@ -85,7 +85,6 @@ jobs:
-e SPRINGDOC_SWAGGER_UI_PATH="${SPRINGDOC_SWAGGER_UI_PATH}" \
-e SPRING_DEVTOOLS_LIVERELOAD_ENABLE="${SPRING_DEVTOOLS_LIVERELOAD_ENABLE}" \
${{ secrets.DOCKERHUB_USERNAME }}/bill-api:latest

# 사용하지 않는 컨테이너 및 이미지 정리

sudo docker rm $(sudo docker ps --filter 'status=exited' -a -q)
sudo docker image prune -a -f
Loading