Update deploy.sh
This commit is contained in:
parent
c8c345ed43
commit
07a31cbb17
1 changed files with 3 additions and 1 deletions
4
.github/scripts/deploy.sh
vendored
4
.github/scripts/deploy.sh
vendored
|
|
@ -8,6 +8,7 @@ DOCKER_IMAGE_NAME="skyjo-be"
|
||||||
CONTAINER_NAME="skyjo-be"
|
CONTAINER_NAME="skyjo-be"
|
||||||
TARGET_DIRECTORY="/home/pb1497/deployments/$CONTAINER_NAME"
|
TARGET_DIRECTORY="/home/pb1497/deployments/$CONTAINER_NAME"
|
||||||
DOCKER_NETWORK="swag_net"
|
DOCKER_NETWORK="swag_net"
|
||||||
|
DOCKER_REGISTRY_TOKEN=$1
|
||||||
|
|
||||||
# Authenticate with Docker registry
|
# Authenticate with Docker registry
|
||||||
echo "Authenticating 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..."
|
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
|
cd $TARGET_DIRECTORY
|
||||||
|
|
||||||
# Stop and remove the existing container if it exists
|
# Stop and remove the existing container if it exists
|
||||||
|
|
@ -34,4 +36,4 @@ docker run -d \
|
||||||
-v $TARGET_DIRECTORY:/app \
|
-v $TARGET_DIRECTORY:/app \
|
||||||
$DOCKER_REGISTRY/$DOCKER_USERNAME/$DOCKER_IMAGE_NAME:latest
|
$DOCKER_REGISTRY/$DOCKER_USERNAME/$DOCKER_IMAGE_NAME:latest
|
||||||
|
|
||||||
echo "Deployment complete."
|
echo "Deployment complete."
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue