Files
TakeoutSaaS.TenantUI/.gitea/workflows/deploy.yml
MSuMshk 371a56c9b1
Some checks failed
Build and Deploy TenantUI / build-and-deploy (push) Failing after 1s
feat: 新增TenantUI主分支自动发布流水线
2026-02-24 10:32:09 +08:00

58 lines
1.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Build and Deploy TenantUI
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: host
steps:
- name: Checkout code
run: |
set -e
cd /opt/deploy/tenantui || mkdir -p /opt/deploy/tenantui
cd /opt/deploy/tenantui
# 如果已有仓库就 pull否则 clone
if [ -d ".git" ]; then
git fetch origin main
git reset --hard origin/main
git clean -fd
else
git clone --branch main ssh://git@git.laosankeji.com:2222/msumshk/TakeoutSaaS.TenantUI.git .
fi
- name: Build on host
run: |
set -e
cd /opt/deploy/tenantui
corepack enable
pnpm install --frozen-lockfile
VITE_GLOB_API_URL=https://api-tenant-dev.laosankeji.com/api/tenant/v1 pnpm run build:antd
rm -rf publish/web-antd-dist
mkdir -p publish
cp -r apps/web-antd/dist publish/web-antd-dist
- name: Build Docker image
run: |
set -e
cd /opt/deploy/tenantui
docker build -t takeoutsaas-tenantui:latest -f scripts/deploy/Dockerfile.runtime .
- name: Deploy container
run: |
docker stop tenantui || true
docker rm tenantui || true
docker run -d \
--name tenantui \
--restart unless-stopped \
-p 8010:8080 \
takeoutsaas-tenantui:latest
- name: Clean up old images
run: |
docker image prune -f