app.xpcool.com/.gitea/workflows/deploy.yml
xpcool 2d84dbbb80
Some checks failed
Build and Deploy (app.xpcool.com) / build-and-deploy (push) Failing after 4m4s
ci: local checkout (no external actions)
2026-08-22 14:30:31 +08:00

53 lines
1.4 KiB
YAML

# deployed by gitea act_runner (push to main/dev triggers this)
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
run: |
apt-get update
apt-get install -y git
- name: Checkout (local Gitea, no external actions)
run: |
git clone --depth 1 https://oauth2:${{ github.token }}@git.xpcool.com/${{ github.repository }}.git .
git checkout ${{ github.sha }}
- name: Use npmmirror registry (faster in CN)
run: npm config set registry https://registry.npmmirror.com
- name: Enable pnpm via corepack
env:
COREPACK_NPM_REGISTRY: https://registry.npmmirror.com
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"