diff --git a/.gitea/workflows/hugo.yml b/.gitea/workflows/hugo.yml index 2094967..9c797f2 100644 --- a/.gitea/workflows/hugo.yml +++ b/.gitea/workflows/hugo.yml @@ -6,47 +6,27 @@ on: pull_request: branches: [ main ] -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: 'pages' - cancel-in-progress: true - jobs: - build: + deploy: runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' steps: - name: Checkout uses: actions/checkout@v4 with: submodules: recursive - - name: Setup Hugo - uses: peaceiris/actions-hugo@v3 + - name: Restart Hugo server on production + 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: - host: 172.20.1.231 - username: root - password: ${{ secrets.SERVER_PASSWORD }} - script: | - cd /var/www/blog - git pull origin main - 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 + host: 172.20.1.231 + username: root + password: ${{ secrets.SERVER_PASSWORD }} + script: | + cd /var/www/blog + git pull origin main + pkill -f "hugo server" || true + 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 & + sleep 3 + curl -f https://dustin.coffee || echo "Health check failed - check /var/log/hugo.log" \ No newline at end of file