diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..470910f --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -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"