diff --git a/.gitea/workflows/hugo.yml b/.gitea/workflows/hugo.yml index 7eec2e2..2094967 100644 --- a/.gitea/workflows/hugo.yml +++ b/.gitea/workflows/hugo.yml @@ -36,16 +36,17 @@ jobs: HUGO_ENV: production run: hugo --minify -- name: Deploy to production server +- name: Deploy to live Hugo server if: github.ref == 'refs/heads/main' uses: appleboy/ssh-action@v1.0.0 with: host: 172.20.1.231 username: root - key: ${{ secrets.SERVER_SSH_KEY }} + password: ${{ secrets.SERVER_PASSWORD }} script: | cd /var/www/blog git pull origin main - hugo --minify - chown -R www-data:www-data /var/www/blog/public - systemctl reload nginx || systemctl reload apache2 || true \ No newline at end of file + pkill -f "hugo server" || true + nohup hugo server --bind 0.0.0.0 --port 1313 --baseURL=https://dustin.coffee --appendPort=false --disableLiveReload > /var/log/hugo.log 2>&1 & + sleep 2 + curl -f https://dustin.coffee || echo "Health check failed" \ No newline at end of file