mirror of
https://github.com/ershisan99/flashcards-api.git
synced 2025-12-17 12:33:22 +00:00
update script
This commit is contained in:
15
.github/workflows/deploy.yml
vendored
15
.github/workflows/deploy.yml
vendored
@@ -32,7 +32,18 @@ jobs:
|
|||||||
username: root
|
username: root
|
||||||
password: ${{ secrets.SSH_PASSWORD }} # Using password instead of key
|
password: ${{ secrets.SSH_PASSWORD }} # Using password instead of key
|
||||||
script: |
|
script: |
|
||||||
|
echo "Pulling latest Docker image..."
|
||||||
docker pull ershisan99/flashcards:latest
|
docker pull ershisan99/flashcards:latest
|
||||||
docker stop flashcards || true
|
|
||||||
docker rm flashcards || true
|
echo "Checking if the container 'flashcards' exists..."
|
||||||
|
if [ $(docker ps -a -q -f name=^/flashcards$) ]; then
|
||||||
|
echo "Container exists. Stopping and removing..."
|
||||||
|
docker stop flashcards
|
||||||
|
docker rm flashcards
|
||||||
|
else
|
||||||
|
echo "No existing container to stop or remove."
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Starting new container..."
|
||||||
docker run -d --name flashcards -p 80:3333 ershisan99/flashcards:latest
|
docker run -d --name flashcards -p 80:3333 ershisan99/flashcards:latest
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user