This commit is contained in:
parent
c0b4e29b8a
commit
e9a05870d6
@ -13,39 +13,25 @@ jobs:
|
|||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: true # Fetch Hugo themes (true OR recursive)
|
submodules: true
|
||||||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
|
||||||
|
|
||||||
- name: Install Hugo
|
- name: Install Hugo
|
||||||
uses: peaceiris/actions-hugo@v2
|
uses: peaceiris/actions-hugo@v2
|
||||||
with:
|
with:
|
||||||
hugo-version: 'latest'
|
hugo-version: 'latest'
|
||||||
extended: true # Install extended version
|
extended: true
|
||||||
|
|
||||||
- name: Debug Working Directory
|
- name: Build Site
|
||||||
run: |
|
run: hugo --minify
|
||||||
pwd
|
|
||||||
ls -la
|
|
||||||
echo "Current directory structure:"
|
|
||||||
find . -type f
|
|
||||||
echo "Mount point check:"
|
|
||||||
ls -la /data/hugo/public || echo "Mount point not accessible"
|
|
||||||
|
|
||||||
- name: Build Hugo Site
|
- name: Setup SSH
|
||||||
run: |
|
run: |
|
||||||
# Create the target directory if it doesn't exist
|
mkdir -p ~/.ssh
|
||||||
mkdir -p /data/hugo/public
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||||
chown -R root:root /data/hugo
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
|
# Add localhost to known hosts to avoid prompt
|
||||||
# Build directly in the workspace
|
ssh-keyscan -H localhost >> ~/.ssh/known_hosts
|
||||||
hugo --minify
|
|
||||||
|
- name: Copy Files to App Server
|
||||||
echo "Contents of generated public directory:"
|
run: |
|
||||||
ls -la public/
|
rsync -avz --delete public/ john@localhost:/home/john/mine/scripts/hugo/public/
|
||||||
|
|
||||||
echo "Copying files to mounted volume..."
|
|
||||||
rm -rf /data/hugo/public/* # Clean target directory first
|
|
||||||
cp -rv public/* /data/hugo/public/
|
|
||||||
|
|
||||||
echo "Final contents of mounted volume:"
|
|
||||||
ls -la /data/hugo/public/
|
|
||||||
Loading…
x
Reference in New Issue
Block a user