Update .gitea/workflows/hugo.yml
Some checks failed
Hugo CI/CD / deploy (push) Has been cancelled

This commit is contained in:
2026-02-14 01:19:36 -05:00
parent 041fb654d5
commit 44e206c78b

View File

@@ -3,30 +3,26 @@ name: Hugo CI/CD
on: on:
push: push:
branches: [ main ] branches: [ main ]
pull_request:
branches: [ main ]
jobs: jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps: steps:
- name: Checkout - name: Deploy via SSH
uses: actions/checkout@v4 uses: appleboy/ssh-action@v1.0.3
with: with:
submodules: recursive host: 172.20.1.231
username: root
- name: Restart Hugo server on production password: ${{ secrets.SERVER_PASSWORD }}
uses: appleboy/ssh-action@v1.0.3 script: |
with: cd /var/www/blog
host: 172.20.1.231 git pull origin main --recurse-submodules
username: root
password: ${{ secrets.SERVER_PASSWORD }} # Build the static site (The 'Hugo Way')
script: | hugo --minify
cd /var/www/blog
git pull origin main pkill -f "hugo server" || true
pkill -f "hugo server" || true sleep 2
sleep 2 nohup hugo server --bind 0.0.0.0 --port 1313 --baseURL=https://dustin.coffee --appendPort=false --disableLiveReload > /var/log/hugo.log 2>&1 &
nohup hugo server --bind 0.0.0.0 --port 1313 --baseURL=https://dustin.coffee --appendPort=false --disableLiveReload > /var/log/hugo.log 2>&1 & sleep 3
sleep 3 curl -f https://dustin.coffee || echo "Health check failed - check /var/log/hugo.log"
curl -f https://dustin.coffee || echo "Health check failed - check /var/log/hugo.log"