Skip to content

Commit

Permalink
fix: wrap run cmd in an if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
ceelogre committed Nov 29, 2024
1 parent 0967ed3 commit 0530310
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ jobs:
docker rm $(docker ps -aq --filter publish=4008) || true
# Run new container
docker run -d \
-p 4008:3000 \
-e PUSHER_APP_KEY=${PUSHER_APP_KEY} \
${{ secrets.DOCKER_HUB_USERNAME2 }}/atlp-devpulse-bn:latest
# wrap this in an if statement to check if the container is running
output=$( docker run -d --name devpulse-bn -p 4008:3000 ${{ secrets.DOCKER_HUB_USERNAME2 }}/atlp-devpulse-bn:latest )
echo "::set-output name=container_id::$output"
echo "Container ID: $output"
if [ -z "$output" ]; then
echo "Container failed to start"
exit 1
fi

0 comments on commit 0530310

Please sign in to comment.