Skip to content

Commit

Permalink
test: deploy test
Browse files Browse the repository at this point in the history
  • Loading branch information
gyehyun-bak committed Oct 24, 2024
1 parent c153573 commit 84e1e44
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: 테스트 및 빌드하기
run: |
chmod +x ./gradlew
./gradlew clean build -x test
./gradlew clean build
- name: AWS Resource에 접근할 수 있게 AWS credentials 설정
uses: aws-actions/configure-aws-credentials@v4
Expand Down Expand Up @@ -54,7 +54,11 @@ jobs:
key: ${{ secrets.EC2_PRIVATE_KEY }}
script_stop: true
script: |
docker stop cano-server || true
docker rm cano-server || true
docker pull ${{ steps.login-ecr.outputs.registry }}/cano-server:latest
docker run -d --name cano-server --network cano-network -p 8080:8080 ${{ steps.login-ecr.outputs.registry }}/cano-server:latest
cd /cano-server
docker compose down || true
docker compose pull
docker compose up -d
# docker stop cano-server || true
# docker rm cano-server || true
# docker pull ${{ steps.login-ecr.outputs.registry }}/cano-server:latest
# docker run -d --name cano-server -p 8080:8080 ${{ steps.login-ecr.outputs.registry }}/cano-server:latest
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
FROM eclipse-temurin:17-jdk-alpine
COPY ./build/libs/*SNAPSHOT.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "app.jar"]
22 changes: 22 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
services:
cano-server:
image: 992382507226.dkr.ecr.ap-northeast-2.amazonaws.com/cano-server
ports:
- 8080:8080
depends_on:
- my-db:
condition: service_healthy

my-db:
image: mysql
environment:
MYSQL_ROOT_PASSWORD: password123
MYSQL_DATABASE: cano
volumes:
- ./mysql-data:/var/lib/mysql
ports:
- 3306:3306
healthcheck:
test: [ "CMD", "mysqladmin", "ping" ]
interval: 5s
retries: 10

0 comments on commit 84e1e44

Please sign in to comment.