auto reload config
This commit is contained in:
parent
0ee64fc64a
commit
3a83992cf8
@ -22,7 +22,10 @@ jobs:
|
|||||||
- name: Configure kubectl
|
- name: Configure kubectl
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.kube
|
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
|
chmod 600 ~/.kube/config
|
||||||
|
|
||||||
- name: Verify cluster connection
|
- name: Verify cluster connection
|
||||||
|
|||||||
@ -22,15 +22,24 @@ Go to your repository → **Settings** → **Secrets**
|
|||||||
Add the following secret:
|
Add the following secret:
|
||||||
|
|
||||||
#### `KUBE_CONFIG`
|
#### `KUBE_CONFIG`
|
||||||
Your base64-encoded kubeconfig file:
|
Your kubeconfig file content. You have two options:
|
||||||
|
|
||||||
|
**Option 1: Base64 encoded (recommended)**
|
||||||
```bash
|
```bash
|
||||||
# Get your kubeconfig in base64 format
|
# Get your kubeconfig in base64 format (single line)
|
||||||
cat ~/.kube/config | base64 -w 0
|
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.
|
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)
|
### 3. Configure Environment (Optional but Recommended)
|
||||||
|
|
||||||
Go to repository → **Settings** → **Environments**
|
Go to repository → **Settings** → **Environments**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user