auto reload config

This commit is contained in:
Alexis Bruneteau 2025-09-05 14:17:31 +02:00
parent 0ee64fc64a
commit 3a83992cf8
2 changed files with 15 additions and 3 deletions

View File

@ -22,7 +22,10 @@ jobs:
- name: Configure kubectl
run: |
mkdir -p ~/.kube
echo "${{ secrets.KUBE_CONFIG }}" | base64 -d > ~/.kube/config
echo "${{ secrets.KUBE_CONFIG }}" | base64 -d > ~/.kube/config || {
echo "Base64 decode failed, trying direct copy..."
echo "${{ secrets.KUBE_CONFIG }}" > ~/.kube/config
}
chmod 600 ~/.kube/config
- name: Verify cluster connection

View File

@ -22,15 +22,24 @@ Go to your repository → **Settings** → **Secrets**
Add the following secret:
#### `KUBE_CONFIG`
Your base64-encoded kubeconfig file:
Your kubeconfig file content. You have two options:
**Option 1: Base64 encoded (recommended)**
```bash
# Get your kubeconfig in base64 format
# Get your kubeconfig in base64 format (single line)
cat ~/.kube/config | base64 -w 0
```
**Option 2: Raw kubeconfig content**
```bash
# If base64 fails, use raw content
cat ~/.kube/config
```
Copy the output and paste it as the value for `KUBE_CONFIG` secret.
> **Note**: The workflow automatically handles both base64-encoded and raw kubeconfig formats.
### 3. Configure Environment (Optional but Recommended)
Go to repository → **Settings** → **Environments**