ci: use unique image tags, add kubectl setup
This commit is contained in:
@@ -21,11 +21,23 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build & Push Docker image
|
||||||
run: |
|
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 }}
|
docker push $REGISTRY/$APP:${{ inputs.environment }}
|
||||||
|
|
||||||
|
- name: Setup kubectl
|
||||||
|
run: |
|
||||||
|
curl -sLO "https://dl.k8s.io/release/v1.36.0/bin/linux/amd64/kubectl"
|
||||||
|
chmod +x kubectl
|
||||||
|
mv kubectl /usr/local/bin/
|
||||||
|
mkdir -p ~/.kube
|
||||||
|
echo "${{ secrets.KUBECONFIG_B64 }}" | base64 -d > ~/.kube/config
|
||||||
|
|
||||||
- name: Deploy to K8s
|
- name: Deploy to K8s
|
||||||
run: |
|
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 }}
|
||||||
|
|||||||
Reference in New Issue
Block a user