feat: 数据库迁移支持
Some checks failed
Deploy to K3s / deploy (push) Failing after 3m52s

This commit is contained in:
2025-12-20 19:58:47 +08:00
parent 59529519e3
commit d3a7d03be7
7 changed files with 87 additions and 15 deletions

View File

@@ -1,3 +1,4 @@
# .gitea/workflows/deploy.yml
name: Deploy to K3s
on:
@@ -15,6 +16,7 @@ jobs:
env:
IMAGE_TAG: ${{ github.sha }}
KUBECONFIG: /tmp/.kube/config
NODE_ENV: production
steps:
- name: Write kubeconfig
@@ -52,6 +54,20 @@ jobs:
-t localhost:5000/frontend:${IMAGE_TAG} .
docker push localhost:5000/frontend:${IMAGE_TAG}
- name: Run database migration job
run: |
cd /workspace/tone/tonePage/apps/deploy
kubectl delete job backend-migration --ignore-not-found
sed "s|IMAGE_TAG|${IMAGE_TAG}|g" backend-migration-job.yaml \
| kubectl apply -f -
kubectl wait \
--for=condition=complete \
job/backend-migration \
--timeout=120s
- name: Deploy to K3s
run: |
cd /workspace/tone/tonePage/apps/deploy