hugo-demo/.gitea/workflows/deploy.yml
liyp 8424c5d274
All checks were successful
Deploy Hugo site / deploy (push) Successful in 36s
删除旧的静态文件并添加新的部署工作流
2024-09-30 18:50:31 +08:00

33 lines
No EOL
815 B
YAML

name: Deploy Hugo site
on:
push:
branches:
- master # 或者您的主分支名称
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
- name: Build Hugo site
run: hugo --minify
- name: Deploy to server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_SSH_KEY }}
script: |
cd /usr/share/nginx/hugo-demo
git pull origin main
hugo --minify
# 如果需要,可以添加额外的部署步骤,比如重启web服务器等