ci: use unique image tags (git sha)

This commit is contained in:
2026-07-19 18:49:23 +08:00
parent 174b4265d7
commit a6dab438d5
+6 -2
View File
@@ -32,9 +32,13 @@ jobs:
- name: Build & Push Docker image
run: |
docker build -t $REGISTRY/$APP:${{ inputs.environment }} .
TAG=${{ github.sha }}
docker build -t $REGISTRY/$APP:$TAG -t $REGISTRY/$APP:${{ inputs.environment }} .
docker push $REGISTRY/$APP:$TAG
docker push $REGISTRY/$APP:${{ inputs.environment }}
- name: Deploy to K8s
run: |
kubectl rollout restart deployment/$APP -n lpt-${{ inputs.environment }}
TAG=${{ github.sha }}
kubectl set image deployment/$APP $APP=$REGISTRY/$APP:$TAG -n lpt-${{ inputs.environment }}
kubectl rollout status deployment/$APP -n lpt-${{ inputs.environment }}