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

[BE] dev환경 배포 방식 수정 #381

Merged
merged 5 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
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
24 changes: 7 additions & 17 deletions .github/workflows/backend-dev-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Backend Dev CD
on:
workflow_dispatch:
push:
branches: ['develop']
branches: [ 'develop' ]

jobs:
detect-changes:
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:

be-depoly:
needs: be-build
runs-on: [self-hosted, linux, ARM64, dev]
runs-on: [ self-hosted, linux, ARM64, dev ]
defaults:
run:
shell: bash
Expand All @@ -103,20 +103,10 @@ jobs:
- name: docker pull
run: docker pull ${{ secrets.DOCKERHUB_USERNAME }}/momo-api-dev

# 2. 기존 컨테이너 중지
- name: docker stop container
run: docker stop $(docker ps -q) 2>/dev/null || true

# 3. 도커 컨테이너 실행
- name: docker run new container
run: >-
docker run --name momo-api-dev
--rm -d -p 8080:8080
--volume=$HOME/security:/momo/security:ro
--volume=$HOME/logs:/momo/logs
--env SPRING_PROFILE=dev
${{ secrets.DOCKERHUB_USERNAME }}/momo-api-dev

# 4. 미사용 이미지를 정리
# 2. 실행 컨테이너 중 app 서비스만 재시작
- name: Restart app service
run: docker compose -f $HOME/security/docker-compose-dev.yml restart app --no-deps

# 3. 미사용 이미지를 정리
- name: delete old docker image
run: docker system prune -f
2 changes: 1 addition & 1 deletion backend/src/main/resources/security