Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Iduoad authored Dec 22, 2023
1 parent 76565a9 commit 47c2f82
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ jobs:
- name: SSH and Deploy Docker image
run: |
docker -H=ssh://${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }} pull miliariadnane/herb-classifier-api:${{ env.BUILD_VERSION }} || exit 1
CONTAINER_ID=\$(docker -H=ssh://${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }} ps -q --filter ancestor=miliariadnane/herb-classifier-api)
if [ "\$CONTAINER_ID" != "" ]; then
docker -H=ssh://${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }} stop \$CONTAINER_ID || true
CONTAINER_ID=$(docker -H=ssh://${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }} ps -q --filter ancestor=miliariadnane/herb-classifier-api)
if [ "$CONTAINER_ID" != "" ]; then
docker -H=ssh://${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }} stop $CONTAINER_ID || true
fi
docker -H=ssh://${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }} run -d -p 80:80 miliariadnane/herb-classifier-api:${{ env.BUILD_VERSION }} || exit 1
EOF
Expand Down

0 comments on commit 47c2f82

Please sign in to comment.