fix(ci): correct YAML syntax for Gitea Actions
Some checks failed
Hugo CI/CD / deploy (push) Has been cancelled
Some checks failed
Hugo CI/CD / deploy (push) Has been cancelled
This commit is contained in:
@@ -6,39 +6,18 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pages: write
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: 'pages'
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Setup Hugo
|
- name: Restart Hugo server on production
|
||||||
uses: peaceiris/actions-hugo@v3
|
uses: appleboy/ssh-action@v1.0.3
|
||||||
with:
|
|
||||||
hugo-version: '0.134.0'
|
|
||||||
extended: true
|
|
||||||
|
|
||||||
- name: Build with Hugo
|
|
||||||
env:
|
|
||||||
HUGO_ENVIRONMENT: production
|
|
||||||
HUGO_ENV: production
|
|
||||||
run: hugo --minify
|
|
||||||
|
|
||||||
- name: Deploy to live Hugo server
|
|
||||||
if: github.ref == 'refs/heads/main'
|
|
||||||
uses: appleboy/ssh-action@v1.0.0
|
|
||||||
with:
|
with:
|
||||||
host: 172.20.1.231
|
host: 172.20.1.231
|
||||||
username: root
|
username: root
|
||||||
@@ -47,6 +26,7 @@ jobs:
|
|||||||
cd /var/www/blog
|
cd /var/www/blog
|
||||||
git pull origin main
|
git pull origin main
|
||||||
pkill -f "hugo server" || true
|
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
|
sleep 2
|
||||||
curl -f https://dustin.coffee || echo "Health check failed"
|
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
|
||||||
|
curl -f https://dustin.coffee || echo "Health check failed - check /var/log/hugo.log"
|
||||||
Reference in New Issue
Block a user