moved to webhook
This commit is contained in:
@@ -1,32 +1,14 @@
|
|||||||
name: Hugo CI/CD
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ main ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ main ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.ref == 'refs/heads/main'
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Restart Hugo server on production
|
|
||||||
uses: appleboy/ssh-action@v1.0.3
|
|
||||||
with:
|
with:
|
||||||
host: 172.20.1.231
|
host: 172.20.1.231
|
||||||
username: root
|
username: root
|
||||||
password: ${{ secrets.SERVER_PASSWORD }}
|
password: ${{ secrets.SERVER_PASSWORD }}
|
||||||
script: |
|
script: |
|
||||||
cd /var/www/blog
|
cd /var/www/blog
|
||||||
git pull origin main
|
git pull origin main --recurse-submodules
|
||||||
pkill -f "hugo server" || true
|
|
||||||
sleep 2
|
# Build the site. This updates the /public folder.
|
||||||
nohup hugo server --bind 0.0.0.0 --port 1313 --baseURL=https://dustin.coffee --appendPort=false --disableLiveReload > /var/log/hugo.log 2>&1 &
|
hugo --minify --baseURL="https://dustin.coffee"
|
||||||
sleep 3
|
|
||||||
curl -f https://dustin.coffee || echo "Health check failed - check /var/log/hugo.log"
|
# Caddy is already running as a service.
|
||||||
|
# It sees the new files in /public immediately.
|
||||||
|
# No restart or pkill required!
|
||||||
Reference in New Issue
Block a user