feat(ci): 添加 imagePullSecret 自动创建步骤
This commit is contained in:
@@ -45,6 +45,15 @@ jobs:
|
|||||||
mkdir -p ~/.kube
|
mkdir -p ~/.kube
|
||||||
echo "${{ secrets.KUBECONFIG_B64 }}" | base64 -d > ~/.kube/config
|
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
|
- name: Deploy to K8s
|
||||||
run: |
|
run: |
|
||||||
kubectl set image deployment/$APP $APP=$REGISTRY/$APP:$IMAGE_TAG -n lpt-${{ inputs.environment }} --record
|
kubectl set image deployment/$APP $APP=$REGISTRY/$APP:$IMAGE_TAG -n lpt-${{ inputs.environment }} --record
|
||||||
|
|||||||
Reference in New Issue
Block a user