Files
outcomes/.gitea/workflows/deploy.yml
T
YaoLei c2f47948bf
Build and deploy Hugo site / build (push) Successful in 10s
Build and deploy Hugo site / deploy (push) Failing after 1s
Use /tmp/shared for public directory instead of /workspace
2026-07-06 13:50:35 +08:00

55 lines
1.6 KiB
YAML

name: Build and deploy Hugo site
on: [push]
jobs:
build:
runs-on: act_runner1
container:
image: 192.168.254.5:5000/hugo:v0.163.3
steps:
- name: Create Hugo site
run: |
set -e
hugo new site /tmp/hugo-site
- name: Clone repository to content directory
run: |
set -e
REPO_URL="http://192.168.8.126:3000/blogs/outcomes.git"
if [ -n "${CI_REPOSITORY_URL:-}" ]; then
REPO_URL="${CI_REPOSITORY_URL}"
fi
echo "Cloning $REPO_URL to content directory"
git clone --depth=1 "$REPO_URL" /tmp/hugo-site/content
- name: Build site with Hugo
working-directory: /tmp/hugo-site
run: |
set -e
hugo --minify
- name: Copy public directory to shared location
run: |
set -e
mkdir -p /tmp/shared/public
cp -r /tmp/hugo-site/public/* /tmp/shared/public/
- name: Show generated files
run: |
echo "Shared public directory contents:"
ls -la /tmp/shared/public || true
deploy:
runs-on: act_runner1
needs: build
steps:
- name: Deploy via rsync
run: |
set -e
# Setup SSH key for rsync
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
# Deploy using rsync
rsync -avz --delete /tmp/shared/public/ root@192.168.254.5:/opt/1panel/www/sites/www.learngaming.top/index/