From 07a31cbb17191afecacd79f286c5ba5d8da51ab8 Mon Sep 17 00:00:00 2001 From: Philipp Beckmann <71174645+pb-coding@users.noreply.github.com> Date: Mon, 23 Oct 2023 22:48:22 +0200 Subject: [PATCH] Update deploy.sh --- .github/scripts/deploy.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/scripts/deploy.sh b/.github/scripts/deploy.sh index 9ee6876..1a5eb3c 100644 --- a/.github/scripts/deploy.sh +++ b/.github/scripts/deploy.sh @@ -8,6 +8,7 @@ DOCKER_IMAGE_NAME="skyjo-be" CONTAINER_NAME="skyjo-be" TARGET_DIRECTORY="/home/pb1497/deployments/$CONTAINER_NAME" DOCKER_NETWORK="swag_net" +DOCKER_REGISTRY_TOKEN=$1 # Authenticate with Docker registry echo "Authenticating with Docker registry..." @@ -17,6 +18,7 @@ docker login -u $DOCKER_USERNAME --password $GITHUB_TOKEN $DOCKER_REGISTRY 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 @@ -34,4 +36,4 @@ docker run -d \ -v $TARGET_DIRECTORY:/app \ $DOCKER_REGISTRY/$DOCKER_USERNAME/$DOCKER_IMAGE_NAME:latest -echo "Deployment complete." \ No newline at end of file +echo "Deployment complete."