Use Hugo deploy for deployment instead of manual rsync
Build and deploy Hugo site / build (push) Failing after 8s
Build and deploy Hugo site / build (push) Failing after 8s
This commit is contained in:
@@ -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
|
||||
@@ -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"
|
||||
Reference in New Issue
Block a user