Add deployment step to sync files to remote server via rsync
Build and deploy Hugo site / build (push) Failing after 7s
Build and deploy Hugo site / build (push) Failing after 7s
This commit is contained in:
@@ -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/
|
||||||
Reference in New Issue
Block a user