Skip to content

Commit

Permalink
Fix: develop.yml sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
su-hwani committed May 2, 2024
1 parent 8398f2e commit 6b8007f
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,35 @@ jobs:
needs: build-and-push
runs-on: ubuntu-latest
steps:
- name: Remove & Change Docker-compose
- name: Install Docker
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.TEST_EC2_PUBLIC_IP }}
username: ubuntu
key: ${{ secrets.TEST_SSH_PRIVATE_KEY }}
envs: GITHUB_SHA
script: |
if ! command -v docker &> /dev/null; then
sudo apt-get update
sudo apt-get install -y docker.io
sudo systemctl start docker
sudo systemctl enable docker
fi
- name: Install Docker-compose
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.TEST_EC2_PUBLIC_IP }}
username: ubuntu
key: ${{ secrets.TEST_SSH_PRIVATE_KEY }}
envs: GITHUB_SHA
script: |
if ! command -v docker-compose &> /dev/null; then
sudo apt-get update
sudo apt-get install -y docker-compose
fi
- name: Remove & Change docker-compose file
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.TEST_EC2_PUBLIC_IP }}
Expand All @@ -62,7 +90,7 @@ jobs:
fi
echo "${{ secrets.DOCKER_COMPOSE }}" > docker-compose.yml
- name: Pull Server Docker image
- name: Remove & Change Server Docker image
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.TEST_EC2_PUBLIC_IP }}
Expand All @@ -74,15 +102,13 @@ jobs:
sudo docker pull ${{ secrets.DOCKER_REPO }}:latest
sudo docker image prune -f
- name: Install Docker-compose & Execute
- name: Docker-compose Execute
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.TEST_EC2_PUBLIC_IP }}
username: ubuntu
key: ${{ secrets.TEST_SSH_PRIVATE_KEY }}
envs: GITHUB_SHA
script: |
sudo apt-get update
sudo apt-get install -y docker-compose
sudo docker-compose up

0 comments on commit 6b8007f

Please sign in to comment.