fix(ci): password SSH + hugo server restart workflow
This commit is contained in:
@@ -36,16 +36,17 @@ jobs:
|
|||||||
HUGO_ENV: production
|
HUGO_ENV: production
|
||||||
run: hugo --minify
|
run: hugo --minify
|
||||||
|
|
||||||
- name: Deploy to production server
|
- name: Deploy to live Hugo server
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
uses: appleboy/ssh-action@v1.0.0
|
uses: appleboy/ssh-action@v1.0.0
|
||||||
with:
|
with:
|
||||||
host: 172.20.1.231
|
host: 172.20.1.231
|
||||||
username: root
|
username: root
|
||||||
key: ${{ secrets.SERVER_SSH_KEY }}
|
password: ${{ secrets.SERVER_PASSWORD }}
|
||||||
script: |
|
script: |
|
||||||
cd /var/www/blog
|
cd /var/www/blog
|
||||||
git pull origin main
|
git pull origin main
|
||||||
hugo --minify
|
pkill -f "hugo server" || true
|
||||||
chown -R www-data:www-data /var/www/blog/public
|
nohup hugo server --bind 0.0.0.0 --port 1313 --baseURL=https://dustin.coffee --appendPort=false --disableLiveReload > /var/log/hugo.log 2>&1 &
|
||||||
systemctl reload nginx || systemctl reload apache2 || true
|
sleep 2
|
||||||
|
curl -f https://dustin.coffee || echo "Health check failed"
|
||||||
Reference in New Issue
Block a user