Skip to content

Commit

Permalink
Update deploy-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
OlhaDanylevska committed Feb 10, 2024
1 parent d75bc7e commit f35fdc1
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/deploy-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,19 @@ jobs:
docker pull olhadanylevska/video-server:${{ steps.create_tag.outputs.tag }}
- name: Identify and stop previous container
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.AWS_HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
CONTAINER_ID=$(docker ps -q --filter ancestor=olhadanylevska/video-server)
if [ ! -z "$CONTAINER_ID" ]; then
docker stop $CONTAINER_ID
docker rm $CONTAINER_ID
fi
- name: Identify and stop previous container
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.AWS_HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
CONTAINER_ID=$(docker ps -q --filter "ancestor=olhadanylevska/video-server:${{ steps.create_tag.outputs.tag }}")
if [ ! -z "$CONTAINER_ID" ]; then
docker stop $CONTAINER_ID
docker rm $CONTAINER_ID
fi
- name: Run container on VM server
uses: appleboy/ssh-action@master
Expand Down

0 comments on commit f35fdc1

Please sign in to comment.