Files
ai-agent/.gitea/workflows/dev-deploy.yaml
T
admin a6a6d34eea
Deploy ai-agent to dev k3s / build-and-deploy (push) Failing after 0s
ci: 移除 checkout action (容器无 node,act_runner 自动 clone)
2026-08-03 14:01:54 +08:00

32 lines
1.2 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.
# ============================================================
# ai-agent dev 分支自动发布
# 触发:push dev 分支
# 流程:构建镜像 -> push 本地仓库(127.0.0.1:5000) -> 部署到 dev 宿主机本地 k3s
# 前置:runner 挂载 dev k3s kubeconfig 到 /root/.kube/k3s-dev.yaml
# ============================================================
name: Deploy ai-agent to dev k3s
on:
push:
branches: [ dev ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
# 注意:act_runner 自动 clone 仓库到工作区,无需 checkout action(容器内无 node
- name: 构建并推送镜像
run: |
TAG=dev-${GITHUB_SHA::8}
docker build -t 127.0.0.1:5000/ai-agent:${TAG} .
docker push 127.0.0.1:5000/ai-agent:${TAG}
- name: 部署到 dev k3s
env:
KUBECONFIG: /root/.kube/k3s-dev.yaml
run: |
kubectl create namespace dev --dry-run=client -o yaml | kubectl apply -f -
kubectl apply -f deploy/k8s/ai-agent.yaml
kubectl set image deployment/ai-agent ai-agent=127.0.0.1:5000/ai-agent:dev-${GITHUB_SHA::8} -n dev
kubectl rollout status deployment/ai-agent -n dev --timeout=5m