feat(ci): 添加 imagePullSecret 自动创建步骤
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user