fix: use /tmp/kubeconfig (writable)
This commit is contained in:
@@ -16,7 +16,7 @@ env:
|
|||||||
APP: lpt-ai
|
APP: lpt-ai
|
||||||
REPO_URL: http://git.cat-shark.xyz/cat-shark/lpt-ai.git
|
REPO_URL: http://git.cat-shark.xyz/cat-shark/lpt-ai.git
|
||||||
|
|
||||||
jobs:
|
Jobs:
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -43,17 +43,16 @@ jobs:
|
|||||||
curl -sLO "https://dl.k8s.io/release/v1.30.0/bin/linux/amd64/kubectl"
|
curl -sLO "https://dl.k8s.io/release/v1.30.0/bin/linux/amd64/kubectl"
|
||||||
chmod +x kubectl
|
chmod +x kubectl
|
||||||
mv kubectl /usr/local/bin/
|
mv kubectl /usr/local/bin/
|
||||||
mkdir -p ~/.kube
|
echo "${{ secrets.KUBECONFIG_B64 }}" | base64 -d > /tmp/kubeconfig
|
||||||
echo "${{ secrets.KUBECONFIG_B64 }}" | base64 -d > ~/.kube/config
|
|
||||||
|
|
||||||
- name: Deploy to K8s
|
- name: Deploy to K8s
|
||||||
run: |
|
run: |
|
||||||
TAG=${{ gitea.sha }}
|
TAG=${{ gitea.sha }}
|
||||||
kubectl set image deployment/$APP $APP=$REGISTRY/$APP:$TAG -n lpt-${{ inputs.environment }} --record
|
kubectl --kubeconfig=/tmp/kubeconfig set image deployment/$APP $APP=$REGISTRY/$APP:$TAG -n lpt-${{ inputs.environment }} --record
|
||||||
kubectl rollout status deployment/$APP -n lpt-${{ inputs.environment }} --timeout=5m
|
kubectl --kubeconfig=/tmp/kubeconfig rollout status deployment/$APP -n lpt-${{ inputs.environment }} --timeout=5m
|
||||||
|
|
||||||
- name: Rollback on failure
|
- name: Rollback on failure
|
||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
kubectl rollout undo deployment/$APP -n lpt-${{ inputs.environment }}
|
kubectl --kubeconfig=/tmp/kubeconfig rollout undo deployment/$APP -n lpt-${{ inputs.environment }}
|
||||||
kubectl rollout status deployment/$APP -n lpt-${{ inputs.environment }}
|
kubectl --kubeconfig=/tmp/kubeconfig rollout status deployment/$APP -n lpt-${{ inputs.environment }}
|
||||||
|
|||||||
Reference in New Issue
Block a user