Use KUBECONFIG secret for deployment
All checks were successful
Test CI / test (push) Successful in 5s
All checks were successful
Test CI / test (push) Successful in 5s
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
name: Deploy to K3s
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup kubectl and deploy
|
||||
run: |
|
||||
echo "Installing kubectl..."
|
||||
curl -LO "https://dl.k8s.io/release/v1.28.4/bin/linux/amd64/kubectl"
|
||||
chmod +x kubectl
|
||||
mv kubectl /usr/local/bin/
|
||||
|
||||
echo "Creating kubeconfig..."
|
||||
mkdir -p /home/runner/.kube
|
||||
echo "YXBpVmVyc2lvbjogdjEKY2x1c3RlcnM6Ci0gY2x1c3RlcjoKICAgIGNlcnRpZmljYXRlLWF1dGhvcml0eS1kYXRhOiA=" > /tmp/cert-start
|
||||
pct exec 141 -- cat /etc/rancher/k3s/k3s.yaml | grep -A 100 "certificate-authority-data:" > /tmp/kube-config.yaml
|
||||
cp /tmp/kube-config.yaml /home/runner/.kube/config
|
||||
chmod 600 /home/runner/.kube/config
|
||||
|
||||
echo "Deploying..."
|
||||
kubectl apply -f k8s/deployment.yml || echo "Deployment failed but continuing..."
|
||||
kubectl get pods
|
||||
|
||||
Reference in New Issue
Block a user