This commit is contained in:
@@ -3,20 +3,12 @@ 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
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Restart Hugo server on production
|
|
||||||
uses: appleboy/ssh-action@v1.0.3
|
uses: appleboy/ssh-action@v1.0.3
|
||||||
with:
|
with:
|
||||||
host: 172.20.1.231
|
host: 172.20.1.231
|
||||||
@@ -24,7 +16,11 @@ jobs:
|
|||||||
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
|
||||||
|
|
||||||
|
# Build the static site (The 'Hugo Way')
|
||||||
|
hugo --minify
|
||||||
|
|
||||||
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 &
|
||||||
|
|||||||
Reference in New Issue
Block a user