Skip to content

Commit 0f484f3

Browse files
Himanshu TiwariHimanshu Tiwari
authored andcommitted
fix: use git init/fetch instead of clone to handle non-empty directory
1 parent ba99229 commit 0f484f3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.github/workflows/deploy.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@ jobs:
5252
cd ~/radar
5353
5454
echo "Pulling latest code..."
55-
if [ -d ".git" ]; then
56-
git fetch origin
57-
git reset --hard origin/main
58-
else
59-
git clone https://github.com/Syntax-Error-1337/radar.git .
55+
if [ ! -d ".git" ]; then
56+
git init
57+
git remote add origin https://github.com/Syntax-Error-1337/radar.git
6058
fi
6159
60+
git fetch origin
61+
git reset --hard origin/main
62+
6263
echo "Stopping containers..."
6364
docker-compose down || true
6465

0 commit comments

Comments
 (0)