Skip to content

Commit

Permalink
[BE] dev환경 배포 방식 수정 (#381)
Browse files Browse the repository at this point in the history
* chore(backend-dev-cd.yml): 도커 컴포즈를 사용하도록 수정

* chore(docker-compose-dev.yml): 개발환경 도커 컴포즈 파일 작성

* chore(docker-compose-dev.yml): githubSecret 사용 제거

* chore(backend-dev-cd.yml): 시큐리티 파일 내부의 도커 컴포즈를 사용하도록 수정

* chore(backend-dev-cd.yml): 파일명 재설정
  • Loading branch information
ehBeak authored Oct 11, 2024
1 parent 1ce5d0c commit 875ccc8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
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

0 comments on commit 875ccc8

Please sign in to comment.