feat(ci): 使用时间戳标签确保每次部署都触发更新

This commit is contained in:
2026-07-19 21:56:14 +08:00
parent 015ecd13d8
commit a42df9d521
+3 -3
View File
@@ -46,10 +46,11 @@ jobs:
- name: Build & Push Docker image
run: |
TAG=${{ gitea.sha }}
TAG=${{ gitea.sha }}-$(date +%s)
docker build -t $REGISTRY/$APP:$TAG -t $REGISTRY/$APP:${{ inputs.environment }} .
docker push $REGISTRY/$APP:$TAG
docker push $REGISTRY/$APP:${{ inputs.environment }}
echo "IMAGE_TAG=$TAG" >> $GITHUB_ENV
- name: Setup kubectl
run: |
@@ -61,8 +62,7 @@ jobs:
- name: Deploy to K8s
run: |
TAG=${{ gitea.sha }}
kubectl set image deployment/$APP $APP=$REGISTRY/$APP:$TAG -n lpt-${{ inputs.environment }} --record
kubectl set image deployment/$APP $APP=$REGISTRY/$APP:$IMAGE_TAG -n lpt-${{ inputs.environment }} --record
kubectl rollout status deployment/$APP -n lpt-${{ inputs.environment }} --timeout=5m
- name: Rollback on failure