68671784f6
deploy notes / build-and-deploy (push) Failing after 2m2s
- backend: POST /api/recordings/:id/feishu → 拼 markdown (总结在最上 + 附件链接到转录/录音 + 转写全文) → 写 /data/feishu-tmp/<id>/ → HTTP POST 到 feishu sidecar
- 复用:已有 feishu_doc_id 时 --update 同一个 doc,前端按钮文案变「↻ 重新生成」
- schema 加 feishu_doc_id + feishu_url 两列(ALTER TABLE 兼容旧 db)
- LLM prompt 改:行动项用 markdown checkbox `- [ ] 谁·做什么·何时`
- sidecar apps/notes/feishu: node:20 + python3 + python3-markdown + @larksuite/cli + COPY 自己的 markdown-to-feishu script + FastAPI /convert
- k8s: deployment 加 feishu container 共享 PVC;lark-cli-creds Secret 挂 /root/.lark-cli/config.json
- CI: 主 image --no-cache(cube 规矩),sidecar 保留 layer cache(chromium-free,但 apt/npm 也大)
- 前端: content 头部加「📤 一键转飞书文档」按钮;已转过显示飞书链接 + 按钮变重生成
64 lines
2.1 KiB
YAML
64 lines
2.1 KiB
YAML
name: deploy notes
|
||
# notes.famzheng.me — 录音 → ASR → LLM 会议纪要
|
||
|
||
on:
|
||
push:
|
||
branches: [master]
|
||
paths:
|
||
- 'apps/notes/**'
|
||
- 'crates/cube-core/**'
|
||
- 'Cargo.toml'
|
||
- 'Cargo.lock'
|
||
- '.gitea/workflows/deploy-notes.yml'
|
||
workflow_dispatch:
|
||
|
||
jobs:
|
||
build-and-deploy:
|
||
runs-on: ubuntu-latest
|
||
env:
|
||
APP: notes
|
||
NS: cube-notes
|
||
IMAGE: registry.famzheng.me/mochi/notes
|
||
FEISHU_IMAGE: registry.famzheng.me/mochi/notes-feishu
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- name: Resolve image tag
|
||
id: tag
|
||
run: echo "sha=$(git rev-parse --short=12 HEAD)" >> "$GITHUB_OUTPUT"
|
||
|
||
- name: Build rust (musl static)
|
||
run: |
|
||
export PATH="$HOME/.cargo/bin:$PATH"
|
||
cargo build --release --target x86_64-unknown-linux-musl -p "$APP"
|
||
|
||
- name: Build frontend
|
||
run: |
|
||
cd "apps/$APP/frontend"
|
||
npm ci
|
||
npm run build
|
||
|
||
- name: Build & push images
|
||
env:
|
||
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||
run: |
|
||
echo "$REGISTRY_TOKEN" | docker login registry.famzheng.me -u mochi --password-stdin
|
||
# main app —— FROM scratch + COPY musl binary,必须 --no-cache(cube docker cache 坑)
|
||
docker build --no-cache -f "apps/$APP/Dockerfile" -t "$IMAGE:${{ steps.tag.outputs.sha }}" .
|
||
docker push "$IMAGE:${{ steps.tag.outputs.sha }}"
|
||
# feishu sidecar —— node+python+chromium-free,layer cache 帮助大不用 --no-cache
|
||
docker build -f "apps/$APP/feishu/Dockerfile" \
|
||
-t "$FEISHU_IMAGE:${{ steps.tag.outputs.sha }}" \
|
||
"apps/$APP/feishu"
|
||
docker push "$FEISHU_IMAGE:${{ steps.tag.outputs.sha }}"
|
||
|
||
- name: Initialize K8s resources
|
||
run: kubectl apply -f apps/notes/k8s/all.yaml
|
||
|
||
- name: Roll out to k3s
|
||
run: |
|
||
kubectl -n "$NS" set image "deploy/$APP" \
|
||
"$APP=$IMAGE:${{ steps.tag.outputs.sha }}" \
|
||
"feishu=$FEISHU_IMAGE:${{ steps.tag.outputs.sha }}"
|
||
kubectl -n "$NS" rollout status "deploy/$APP" --timeout=300s
|