Skip to content

Commit

Permalink
[Feat]: fix github action
Browse files Browse the repository at this point in the history
  • Loading branch information
bayy1216 committed Jun 19, 2024
1 parent baaadeb commit 2a06ee6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
distribution: 'adopt'

- name: Setup Gradle # Gradle을 설정합니다.
run: |
Expand All @@ -44,16 +44,17 @@ jobs:
id: deploy
with:
host: ${{ secrets.HOST }}
username: ec2-user
username: ubuntu
key: ${{ secrets.KEY }}
port: 22
script: |
docker rm -f $(docker ps -qa) # 기존에 실행되고 있는 도커 프로세스들을 제거합니다.
docker rm -f $(docker ps -qa --filter "name=zzansuni-spring") # 기존 zzansuni-spring 서버만 잡아서 중지합니다.
docker rmi $(docker images -q) # 기존에 사용되고 있는 도커 이미지들을 제거합니다.
docker image prune -f # 사용하지 않는 도커 이미지들을 제거합니다.
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:${{ github.sha }}
docker run -d -p 80:8080 -e SPRING_PROFILES_ACTIVE=prod \
docker run -d -p 8080:8080 -e SPRING_PROFILES_ACTIVE=prod \
--name zzansuni-spring \
-e KAKAO_CLIENT_SECRET=${{ secrets.KAKAO_CLIENT_SECRET }} \
-e NAVER_CLIENT_SECRET=${{ secrets.NAVER_CLIENT_SECRET }} \
-e KAKAO_REDIRECT_URI=${{ secrets.KAKAO_REDIRECT_URI }} \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM amd64/amazoncorretto:17
FROM openjdk:17-alpine
WORKDIR /usr/src/app
ARG JAR_FILE=zzansuni-api-server/app/build/libs/*.jar
COPY ${JAR_FILE} app.jar
Expand Down

0 comments on commit 2a06ee6

Please sign in to comment.