From 4a5baeb74213ec0dae40c39b8f913d90ecd4cfc9 Mon Sep 17 00:00:00 2001 From: Philipp Beckmann <71174645+pb-coding@users.noreply.github.com> Date: Mon, 23 Oct 2023 22:20:15 +0200 Subject: [PATCH] Update deploy.sh --- .github/scripts/deploy.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/scripts/deploy.sh b/.github/scripts/deploy.sh index cd02699..5168f12 100644 --- a/.github/scripts/deploy.sh +++ b/.github/scripts/deploy.sh @@ -6,6 +6,7 @@ DOCKER_REGISTRY="ghcr.io" DOCKER_USERNAME="pb-coding" DOCKER_IMAGE_NAME="skyjo-fe" CONTAINER_NAME="skyjo-fe" +TARGET_DIRECTORY="/home/pb1497/deployments/$CONTAINER_NAME" DOCKER_NETWORK="swag_net" DOCKER_REGISTRY_TOKEN=$1 @@ -17,6 +18,9 @@ docker login -u $DOCKER_USERNAME --password $DOCKER_REGISTRY_TOKEN $DOCKER_REGIS echo "Pulling the latest Docker image..." docker pull $DOCKER_REGISTRY/$DOCKER_USERNAME/$DOCKER_IMAGE_NAME:latest +mkdir -p $TARGET_DIRECTORY +cd $TARGET_DIRECTORY + # Stop and remove the existing container if it exists if [ "$(docker ps -aq -f name=$CONTAINER_NAME)" ]; then echo "Stopping and removing the existing container..."