Add deployment step to sync files to remote server via rsync
Build and deploy Hugo site / build (push) Failing after 7s

This commit is contained in:
YaoLei
2026-07-06 10:15:12 +08:00
parent 104eb005d9
commit 62dd64da14
+15 -1
View File
@@ -32,4 +32,18 @@ jobs:
working-directory: /tmp/hugo-site working-directory: /tmp/hugo-site
run: | run: |
echo "Public directory contents:" echo "Public directory contents:"
ls -la public || true ls -la public || true
- name: Deploy to remote server
working-directory: /tmp/hugo-site
run: |
set -e
# Install ssh client and rsync for Alpine
apk add --no-cache openssh-client rsync
# Setup SSH key
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H 192.168.254.5 >> ~/.ssh/known_hosts
# Copy files to remote server
rsync -avz --delete public/ root@192.168.254.5:/opt/1panel/www/sites/www.learngaming.top/index/