Skip to content

Commit

Permalink
Chore: 워크플로우 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
saokiritoni authored Nov 4, 2024
1 parent 626f274 commit a0f1fb7
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,9 @@ jobs:
restore-keys: |
gradle-${{ runner.os }}-
# Gradle 빌드
- name: Build with Gradle Wrapper
run: ./gradlew build

# 빌드 후 JAR 파일 이름 변경 (app.jar로 통일)
- name: Rename JAR file
run: |
mv build/libs/*.jar build/libs/app.jar
# Docker 빌드 및 Docker Hub에 푸시
- name: Docker build & push to Docker Hub
run: |
Expand All @@ -74,22 +68,14 @@ jobs:
sudo docker rm docker-test
fi
# 새 컨테이너 실행 및 application.yml 확인
sudo docker run -d --name docker-test -p 8080:8080 \
-e DB_URL=${{ secrets.DB_URL }} \
-e DB_USERNAME=${{ secrets.DB_USERNAME }} \
-e DB_PASSWORD=${{ secrets.DB_PASSWORD }} \
-e REDIS_HOST=${{ secrets.REDIS_HOST }} \
-e REDIS_PORT=${{ secrets.REDIS_PORT }} \
-e SMTP_HOST=${{ secrets.SMTP_HOST }} \
-e SMTP_PORT=${{ secrets.SMTP_PORT }} \
-e SMTP_USERNAME=${{ secrets.SMTP_USERNAME }} \
-e SMTP_PASSWORD=${{ secrets.SMTP_PASSWORD }} \
${{ secrets.DOCKER_USERNAME }}/docker-test:latest \
sh -c "ls /app/resources/application.yml && cat /app/resources/application.yml && java -jar /app/app.jar"
# 새 컨테이너 실행 및 환경 변수 전달
sudo docker run -d --log-driver=syslog --name docker-test -p 8080:8080 \
--env-file ~/.env \
${{ secrets.DOCKER_USERNAME }}/docker-test:latest
# 실행 중인 컨테이너 확인
sudo docker ps -a | grep "docker-test"
# 사용하지 않는 이미지 및 컨테이너 정리
sudo docker image prune -a -f

0 comments on commit a0f1fb7

Please sign in to comment.