Update .gitea/workflows/deploy.yaml
Deploy Dashboard Monitor ke K3s / deploy (push) Failing after 3s Details

This commit is contained in:
Administrator 2026-06-22 17:44:09 +08:00
parent 302191eb4a
commit ac1292005a
1 changed files with 12 additions and 9 deletions

View File

@ -7,15 +7,18 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Deploy dengan Konfigurasi Mount - name: Deploy via SCP (Jalur Luar Container)
env: env:
# Memaksa kubectl membaca file yang kita mount di docker-compose # SSH_PRIVATE_KEY harus diisi dengan isi file /root/.ssh/id_rsa Anda
KUBECONFIG: /root/.kube/config SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: | run: |
curl -LO "https://dl.k8s.io/release/v1.28.2/bin/linux/amd64/kubectl" # 1. Simpan key ke file
chmod +x ./kubectl echo "$SSH_PRIVATE_KEY" > deploy_key
chmod 600 deploy_key
echo "=> Menjalankan kubectl dengan konfigurasi yang tepat..." # 2. Kirim file deployment ke VPS
./kubectl get nodes scp -o StrictHostKeyChecking=no -i deploy_key dashdot-deploy.yaml root@43.134.163.21:/tmp/dashdot-deploy.yaml
./kubectl apply -f dashdot-deploy.yaml
./kubectl rollout status deployment/dashdot # 3. Jalankan kubectl di VPS (bukan di dalam container runner)
ssh -o StrictHostKeyChecking=no -i deploy_key root@43.134.163.21 "KUBECONFIG=/etc/rancher/k3s/k3s.yaml kubectl apply -f /tmp/dashdot-deploy.yaml"
ssh -o StrictHostKeyChecking=no -i deploy_key root@43.134.163.21 "KUBECONFIG=/etc/rancher/k3s/k3s.yaml kubectl rollout status deployment/dashdot"