Skip to content

feat: enhance FormEditor with production template validation and upda… #19

feat: enhance FormEditor with production template validation and upda…

feat: enhance FormEditor with production template validation and upda… #19

Workflow file for this run

# 自托管 CI:push 到 deploy 分支 → 在 149 上 buildah 构建 → 推内网 zot → kubectl set image 部署
# runner: 149 上的 self-hosted runner(labels: self-hosted, teable)
name: build & deploy (zot)
on:
push:
branches: [deploy]
workflow_dispatch:
# 避免并发部署互相打架
concurrency:
group: deploy-zot
cancel-in-progress: false
jobs:
build-push-deploy:
runs-on: [self-hosted, teable]
env:
IMAGE_REPO: zot.opsuse.linkto/teable
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
steps:
- uses: actions/checkout@v4
- name: 算镜像 tag
id: img
run: |
TAG="deploy-$(date -u +%Y%m%d-%H%M%S)-g${GITHUB_SHA::8}"
echo "ref=${IMAGE_REPO}:${TAG}" >> "$GITHUB_OUTPUT"
echo "镜像: ${IMAGE_REPO}:${TAG}"
- name: 构建(buildah,原始 build 脚本,不碰 deploy-buildah.sh)
run: ./scripts/build-image-buildah.sh --tag "${{ steps.img.outputs.ref }}"
- name: 推送到 zot
run: buildah push "${{ steps.img.outputs.ref }}" "docker://${{ steps.img.outputs.ref }}"
- name: 部署(换镜像,不动 postgres/minio/secret)
run: |
# 一次性确保能从 zot 拉(现网原本是 Never,会拒绝拉新 tag);幂等,已是 IfNotPresent 则无变化
kubectl -n teable patch deployment teable \
-p '{"spec":{"template":{"spec":{"containers":[{"name":"teable","imagePullPolicy":"IfNotPresent"}]}}}}'
kubectl -n teable set image deployment/teable teable="${{ steps.img.outputs.ref }}"
kubectl -n teable rollout status deployment/teable --timeout=8m
- name: 完成
run: echo "已部署 ${{ steps.img.outputs.ref }}"