-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: 워크플로 테스트 트리거 추가 * chore: 서버로 컴포즈 파일을 전송하는 스텝 추가 * chore: 빌드 시 자바 이미지 eclipse-temurin으로 변경 * chore: 컴포즈 파일 작성 * chore: 컴포즈 파일에 사용할 환경변수 설정 * chore: 시크릿을 사용하도록 변경 * fix: 권한 문제 수정 * chore: 도커 컴포즈를 실행하도록 변경 * fix: scp action의 버전을 고정하도록 변경 * fix: 오타 수정 * fix: 유저네임 변경 * fix: 쉘에서 환경변수 전달하도록 수정 * fix: 사용할 환경변수 지정 * chore: 도커 미사용 리소스 삭제 명령어 추가 * fix: 이미지만 삭제하도록 수정 * fix: 환경변수 수정 * chore: 호스트 모드 사용 시 포트 바인딩 옵션 제거 * chore: 컴포즈가 전역 컨텍스트의 환경변수를 직접 참조하도록 수정 테스트 * fix: 주석 수정 * Revert "fix: 주석 수정" This reverts commit 0e8f426. * Revert "chore: 컴포즈가 전역 컨텍스트의 환경변수를 직접 참조하도록 수정 테스트" This reverts commit b910404. * docs: 주석 추가 * chore: 주석 처리한 명령어 제거 * chore: 워크플로 테스트 트리거 롤백 * chore: 배포 전용 워크플로에 변경사항 적용
- Loading branch information
Showing
4 changed files
with
36 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,20 +61,35 @@ jobs: | |
push: true | ||
tags: ${{ secrets.NCP_CONTAINER_REGISTRY }}/server-spring:${{ steps.github-sha-short.outputs.sha }} | ||
|
||
# 서버로 docker-compose 파일 전송 | ||
- name: Copy docker-compose.yml to NCP Server | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.NCP_HOST }} | ||
username: tenminute | ||
key: ${{ secrets.NCP_PRIVATE_KEY }} | ||
port: ${{ secrets.NCP_PORT }} | ||
source: docker-compose.yaml | ||
target: /home/tenminute/ | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
environment: DEV | ||
needs: build | ||
steps: | ||
- name: Login to NCP Server | ||
- name: Deploy to NCP Server | ||
uses: appleboy/ssh-action@master | ||
env: | ||
NCP_CONTAINER_REGISTRY: ${{ secrets.NCP_CONTAINER_REGISTRY }} | ||
NCP_IMAGE_TAG: ${{ needs.build.outputs.sha }} | ||
with: | ||
host: ${{ secrets.NCP_HOST }} | ||
username: tenminute | ||
key: ${{ secrets.NCP_PRIVATE_KEY }} | ||
port: ${{ secrets.NCP_PORT }} | ||
envs: NCP_CONTAINER_REGISTRY,NCP_IMAGE_TAG # docker-compose.yml 에서 사용할 환경 변수 | ||
script: | | ||
echo "${{ secrets.NCP_SECRET_KEY }}" | docker login -u "${{ secrets.NCP_ACCESS_KEY }}" --password-stdin "${{ secrets.NCP_CONTAINER_REGISTRY }}" | ||
docker pull ${{ secrets.NCP_CONTAINER_REGISTRY }}/server-spring:${{ needs.build.outputs.sha }} | ||
docker stop server-spring && docker rm server-spring | ||
docker run -d --name server-spring -p 8080:8080 -d ${{ secrets.NCP_CONTAINER_REGISTRY }}/server-spring:${{ needs.build.outputs.sha }} | ||
docker compose -f /home/tenminute/docker-compose.yaml up -d | ||
docker image prune -a -f |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM amazoncorretto:17 | ||
FROM eclipse-temurin:17 | ||
ARG JAR_FILE=build/libs/*.jar | ||
COPY ${JAR_FILE} app.jar | ||
ENTRYPOINT ["java","-jar","/app.jar"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: "3.8" | ||
|
||
services: | ||
backend: | ||
image: ${NCP_CONTAINER_REGISTRY}/server-spring:${NCP_IMAGE_TAG} | ||
container_name: server-spring | ||
restart: always | ||
network_mode: host |