Use Hugo deploy for deployment instead of manual rsync
Build and deploy Hugo site / build (push) Failing after 8s

This commit is contained in:
YaoLei
2026-07-06 10:37:16 +08:00
parent 0cde52e0d1
commit 66c48042ed
2 changed files with 14 additions and 3 deletions
+6 -3
View File
@@ -6,6 +6,7 @@ jobs:
runs-on: act_runner1
container:
image: 192.168.254.5:5000/hugo:v0.163.3
options: --privileged
steps:
- name: Create Hugo site
run: |
@@ -38,10 +39,12 @@ jobs:
working-directory: /tmp/hugo-site
run: |
set -e
# Setup SSH key
# Copy config file from content directory to Hugo site root
cp content/config.toml /tmp/hugo-site/
# Setup SSH key for Hugo deploy
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/
# Deploy using Hugo
hugo deploy
+8
View File
@@ -0,0 +1,8 @@
baseURL = "https://www.learngaming.top/"
title = "Learn Gaming"
languageCode = "en-us"
[deployment]
[[deployment.targets]]
name = "production"
URL = "rsync://root@192.168.254.5:/opt/1panel/www/sites/www.learngaming.top/index"