From 6c739455e470f2e27a81c05059efae91ba7ba871 Mon Sep 17 00:00:00 2001 From: xpcool Date: Sat, 22 Aug 2026 14:18:24 +0800 Subject: [PATCH] ci: add gitea actions deploy workflow --- .gitea/workflows/deploy.yml | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 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..c823fe5 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,42 @@ +name: Build and Deploy (app.xpcool.com) + +on: + push: + branches: [main, dev] + workflow_dispatch: + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Install git (node image has no git) + run: apt-get update && apt-get install -y git + + - name: Checkout + uses: actions/checkout@v4 + + - name: Enable pnpm via corepack + run: | + corepack enable + corepack prepare pnpm@10 --activate + + - name: Install dependencies + run: pnpm install + + - name: Build (uni-app H5) + run: pnpm build + + - name: Deploy to /data/www/app.xpcool.com + run: | + set -e + SRC=dist/build/h5 + DST=/data/www/app.xpcool.com + if [ ! -d "$SRC" ]; then + echo "BUILD OUTPUT NOT FOUND: $SRC" + exit 1 + fi + mkdir -p "$DST" + find "$DST" -mindepth 1 -delete + cp -r "$SRC"/. "$DST"/ + chmod -R a+rX "$DST" + echo "Deployed app.xpcool.com -> $DST"