diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 535bb4b..d5e3a80 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -32,4 +32,18 @@ jobs: working-directory: /tmp/hugo-site run: | echo "Public directory contents:" - ls -la public || true \ No newline at end of file + 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/ \ No newline at end of file