Skip to content

Commit 3c76db4

Browse files
committed
revert: workflow ci
1 parent d014f2c commit 3c76db4

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,14 @@ jobs:
2727
SSH_USER: ${{ secrets.SSH_USER }}
2828
BLOG_PATH_REMOTE: ${{ secrets.BLOG_PATH_REMOTE }}
2929
run: |
30-
mkdir -p ~/.ssh
31-
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
32-
chmod 600 ~/.ssh/id_rsa
33-
ssh-keyscan $SSH_HOST >> ~/.ssh/known_hosts
34-
ssh $SSH_USER@$SSH_HOST << 'EOF'
3530
cd $BLOG_PATH_REMOTE
3631
3732
MAX_RETRIES=8
3833
RETRY_COUNT=0
3934
4035
while [ \$RETRY_COUNT -lt \$MAX_RETRIES ]; do
4136
if git pull origin main; then
42-
break # pull successful, exit loop
37+
break # pull succesful exit
4338
else
4439
echo "Git pull failed, retrying (\$((RETRY_COUNT + 1)) of \$MAX_RETRIES)..."
4540
((RETRY_COUNT++))
@@ -52,20 +47,4 @@ jobs:
5247
echo "Failed to pull code after \$MAX_RETRIES attempts. Exiting."
5348
exit 1 # throw error
5449
fi
55-
56-
# Build Docker image
57-
docker build -t nextjs .
58-
59-
# Stop the running container (if any)
60-
if docker ps -q --filter "name=blog" | grep -q .; then
61-
docker stop blog
62-
fi
63-
64-
# Remove the stopped container (optional, but recommended for cleanup)
65-
if docker ps -aq --filter "name=blog" | grep -q .; then
66-
docker rm blog
67-
fi
68-
69-
# Start the new container using docker-compose
70-
docker compose up -d
7150
EOF

0 commit comments

Comments
 (0)