-
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.
- Loading branch information
Showing
3 changed files
with
43 additions
and
15 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 |
---|---|---|
|
@@ -37,9 +37,19 @@ jobs: | |
needs: ci # ci job이 성공적으로 끝나야 cd job이 실행됩니다. | ||
|
||
# appleboy/ssh-action@master 액션을 사용하여 지정한 서버에 ssh로 접속하고, script를 실행합니다. | ||
# script의 내용은 도커의 기존 프로세스들을 제거하고, docker repo로부터 방금 위에서 push한 내용을 pull 받아 실행하는 것입니다. | ||
# script의 내용은 도커의 기존 프로세스들을 제거하고, docker repo로부터 방금 위에서 push한 내용을 pull 받아 실행하는 것입니다. | ||
# 실행 시, docker-compose를 사용합니다. | ||
steps: | ||
# - name: ✔️ send docker-compose.yml to EC2 server | ||
# uses: appleboy/[email protected] | ||
# with: | ||
# username: ec2-user | ||
# host: ${{ secrets.HOST }} | ||
# key: ${{ secrets.KEY }} | ||
# port: 22 | ||
# source: "dev/docker-compose.dev.yml" | ||
# target: "/home/ec2-user" | ||
|
||
- name: Deploy to server | ||
uses: appleboy/ssh-action@master | ||
id: deploy | ||
|
@@ -54,3 +64,5 @@ jobs: | |
docker image prune -f # 사용하지 않는 도커 이미지들을 제거합니다. | ||
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:${{ github.sha }} | ||
docker run -d -p 80:8080 ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:${{ github.sha }} | ||
#docker-compose -f /home/ec2-user/docker-compose.dev.yml up -d | ||
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,30 @@ | ||
version: '3' | ||
# 실행명령어 | ||
# docker-compose -f ./docker-compose.dev.yml up | ||
services: | ||
zzansuni-mysql: | ||
image: mysql | ||
restart: always | ||
volumes: | ||
- ./mysql-data:/var/lib/mysql | ||
ports: | ||
- "3306:3306" | ||
environment: | ||
MYSQL_DATABASE: zzansuni | ||
MYSQL_ROOT_PASSWORD: root | ||
zzanuni-spring: | ||
image: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:${{ github.sha }} | ||
restart: always | ||
ports: | ||
- "80:8080" | ||
depends_on: | ||
- zzansuni-mysql | ||
environment: | ||
SPRING_PROFILES_ACTIVE: dev | ||
JWT_SECRET: 4099a46b-39db-4860-a61b-2ae76ea24c43 | ||
KAKAO_CLIENT_ID: ${{ secrets.KAKAO_CLIENT_ID }} | ||
KAKAO_CLIENT_SECRET: ${{ secrets.KAKAO_CLIENT_SECRET }} | ||
KAKAO_REDIRECT_URI: ${{ secrets.KAKAO_REDIRECT_URI }} | ||
NAVER_CLIENT_ID: ${{ secrets.NAVER_CLIENT_ID }} | ||
NAVER_CLIENT_SECRET: ${{ secrets.NAVER_CLIENT_SECRET }} | ||
|
This file was deleted.
Oops, something went wrong.