Update deploy.sh

This commit is contained in:
Philipp Beckmann 2023-10-23 22:20:15 +02:00 committed by GitHub
parent 6277be8c01
commit 4a5baeb742
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,6 +6,7 @@ DOCKER_REGISTRY="ghcr.io"
DOCKER_USERNAME="pb-coding" DOCKER_USERNAME="pb-coding"
DOCKER_IMAGE_NAME="skyjo-fe" DOCKER_IMAGE_NAME="skyjo-fe"
CONTAINER_NAME="skyjo-fe" CONTAINER_NAME="skyjo-fe"
TARGET_DIRECTORY="/home/pb1497/deployments/$CONTAINER_NAME"
DOCKER_NETWORK="swag_net" DOCKER_NETWORK="swag_net"
DOCKER_REGISTRY_TOKEN=$1 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..." echo "Pulling the latest Docker image..."
docker pull $DOCKER_REGISTRY/$DOCKER_USERNAME/$DOCKER_IMAGE_NAME:latest 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 # Stop and remove the existing container if it exists
if [ "$(docker ps -aq -f name=$CONTAINER_NAME)" ]; then if [ "$(docker ps -aq -f name=$CONTAINER_NAME)" ]; then
echo "Stopping and removing the existing container..." echo "Stopping and removing the existing container..."