feat(ci): 添加 imagePullSecret 自动创建步骤

This commit is contained in:
2026-07-19 22:45:59 +08:00
parent 6eca6de249
commit d5d9b7aa99
+9
View File
@@ -60,6 +60,15 @@ jobs:
mkdir -p ~/.kube
echo "${{ secrets.KUBECONFIG_B64 }}" | base64 -d > ~/.kube/config
- name: Create/Update imagePullSecret
run: |
kubectl create secret docker-registry regcred \
--docker-server=$REGISTRY \
--docker-username="${{ secrets.REGISTRY_USERNAME }}" \
--docker-password="${{ secrets.REGISTRY_PASSWORD }}" \
-n lpt-${{ inputs.environment }} \
--dry-run=client -o yaml | kubectl apply -f -
- name: Deploy to K8s
run: |
kubectl set image deployment/$APP $APP=$REGISTRY/$APP:$IMAGE_TAG -n lpt-${{ inputs.environment }} --record