Skip to content

Commit

Permalink
ci: docker 일반 명령어로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
jinyongp committed Oct 23, 2023
1 parent cb86be9 commit 3b49838
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,6 @@ jobs:
push: true
tags: ${{ secrets.DK_USERNAME }}/${{ secrets.DK_IMAGE }}:latest

- name: Send docker-compose.yml, .env to EC2
uses: appleboy/[email protected]
with:
host: ${{ secrets.EC2_HOST }}
username: ubuntu
key: ${{ secrets.EC2_KEY }}
source: docker-compose.yml,.env
target: /home/ubuntu

- name: Deploy Docker to EC2
uses: appleboy/[email protected]
with:
Expand All @@ -64,10 +55,14 @@ jobs:
key: ${{ secrets.EC2_KEY }}
script_stop: true
script: |
mv .env /tmp
export $(cat /tmp/.env | xargs)
sudo docker compose pull
sudo docker compose up -d
sudo docker pull mysql:8.1.0
sudo docker pull ${{ secrets.DK_USERNAME }}/${{ secrets.DK_IMAGE }}:latest
sudo docker network create api-network
sudo docker run --name ${DK_IMAGE}-db \
-e MYSQL_DATABASE=${DB_DATABASE} -e MYSQL_PASSWORD=${DB_PASSWORD} -e TZ=${TZ} \
-v mysql-data:/var/lib/mysql -p ${DB_PORT}:3306 -d mysql:8.1.0 --default-authentication-plugin=mysql_native_password
sudo docker run --name ${DK_IMAGE} \
--link ${DK_IMAGE}-db:db -p ${PORT}:${PORT} -d ${DK_USERNAME}/${DK_IMAGE}:latest /home/bun/app/wait-for-db.sh
sudo docker container prune -f
sudo docker image prune -f
rm -f docker-compose.yml /tmp/.env

0 comments on commit 3b49838

Please sign in to comment.