From a33387187b0f8447fe716f5cb0cb3340878da62b Mon Sep 17 00:00:00 2001 From: WangDL Date: Fri, 22 May 2026 09:54:36 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20add=20admin=20deploy=20workflow=20?= =?UTF-8?q?=E2=80=94=20build=20&=20deploy=20to=208-core=20server?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 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..40b7879 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,32 @@ +name: Deploy Admin Frontend + +on: + push: + branches: [main] + +jobs: + build-and-deploy: + runs-on: prod + steps: + - name: Checkout latest code + run: | + if [ -d /tmp/admin-projects ]; then + cd /tmp/admin-projects && git pull + else + git clone http://10.2.0.7:3000/suche-Hermes/admin-projects.git /tmp/admin-projects + fi + + - name: Install dependencies and build + run: | + cd /tmp/admin-projects + npm ci + npm run build + + - name: Deploy to production + run: | + rsync -av --delete /tmp/admin-projects/dist/ /opt/zhixi/admin/dist/ + sudo systemctl reload nginx + + - name: Health check + run: | + curl -sf -o /dev/null https://admin.longde.cloud && echo "[deploy] Admin health OK" || echo "[deploy] Admin health check failed"