From b55a13519062d1452c4d77828dda95a3f1af471b Mon Sep 17 00:00:00 2001 From: guocheng Date: Tue, 28 Jul 2026 02:07:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=87=AA=E5=8A=A8=E6=9E=84?= =?UTF-8?q?=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy.yml | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..1e12724 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,43 @@ +name: Build and Deploy Documentation + +on: + push: + branches: [main] + workflow_dispatch: + +concurrency: + group: docs-deploy + cancel-in-progress: true + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + cache: pip + + - name: Install dependencies + run: pip install --retries 3 -r requirements.txt + + - name: Build documentation + run: python doc_builder/build.py + + - name: Deploy to Caddy + env: + WEBDAV_URL: ${{ secrets.WEBDAV_URL }} + WEBDAV_USER: ${{ secrets.WEBDAV_USER }} + WEBDAV_PASS: ${{ secrets.WEBDAV_PASS }} + run: | + for f in output/*.html; do + echo "上传: $(basename "$f")" + curl -sS --retries 3 -u "${WEBDAV_USER}:${WEBDAV_PASS}" \ + -T "$f" "${WEBDAV_URL}/$(basename "$f")" + done + echo "部署完成"