ci: add auto-deploy workflow on push to main
Deploy Wiki to Production / deploy (push) Failing after 1m30s

This commit is contained in:
zdh
2026-06-04 15:03:49 +08:00
parent 3bfa6c7c4c
commit fb82f91e43
+32
View File
@@ -0,0 +1,32 @@
name: Deploy Wiki to Production
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install sshpass
run: apt-get update -qq && apt-get install -y -qq sshpass
- name: Deploy to server
run: |
sshpass -p "${{ secrets.DEPLOY_PASSWORD }}" rsync -avz \
--exclude='.git' \
--exclude='.claude' \
--exclude='.gitea' \
--exclude='.gitignore' \
--exclude='CLAUDE.md' \
--exclude='*.pptx' \
--exclude='*.xlsx' \
--delete \
./ ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:/data/
- name: Reload nginx
run: |
sshpass -p "${{ secrets.DEPLOY_PASSWORD }}" ssh ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} "nginx -s reload"