Skip to content
This repository was archived by the owner on Jul 20, 2026. It is now read-only.

Commit 2633b88

Browse files
Update deploy.yml
1 parent 6b43d3d commit 2633b88

1 file changed

Lines changed: 9 additions & 18 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,13 @@ jobs:
1717
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/deploy_key
1818
chmod 600 ~/.ssh/deploy_key
1919
20-
- name: Create SFTP batch commands
20+
- name: Deploy with rsync
2121
run: |
22-
# Generate list of files to upload
23-
cat > sftp_commands.txt << 'EOF'
24-
cd html
25-
EOF
26-
27-
# Add commands to upload each file
28-
find . -type f -not -path "./.git/*" -not -path "./.github/*" -not -path "./node_modules/*" -not -name ".env" | while read file; do
29-
echo "put \"$file\" \"${file#./}\"" >> sftp_commands.txt
30-
done
31-
32-
- name: Deploy via SFTP
33-
run: |
34-
sftp -b sftp_commands.txt \
35-
-P ${{ secrets.SERVER_PORT }} \
36-
-i ~/.ssh/deploy_key \
37-
-o StrictHostKeyChecking=accept-new \
38-
${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_HOST }}
22+
rsync -avz --delete \
23+
-e "ssh -p ${{ secrets.SERVER_PORT }} -i ~/.ssh/deploy_key -o StrictHostKeyChecking=accept-new" \
24+
--exclude '.git' \
25+
--exclude '.github' \
26+
--exclude 'node_modules' \
27+
--exclude '.env' \
28+
--exclude '.gitignore' \
29+
./ ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_HOST }}:/var/www/html/

0 commit comments

Comments
 (0)