ci: add kubectl install + idempotent manifest apply (rebours pattern)
Some checks failed
Build & Deploy / deploy (push) Failing after 1s
Some checks failed
Build & Deploy / deploy (push) Failing after 1s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6fdfbab996
commit
be01895c92
@ -34,12 +34,31 @@ jobs:
|
||||
-t "$PWA_TAG" .
|
||||
docker push "$PWA_TAG"
|
||||
|
||||
- name: Install kubectl
|
||||
run: |
|
||||
curl -LO "https://dl.k8s.io/release/$(curl -Ls https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
||||
chmod +x kubectl && mv kubectl /usr/local/bin/kubectl
|
||||
|
||||
- name: Deploy on K3s
|
||||
env:
|
||||
KUBECONFIG_DATA: ${{ secrets.KUBECONFIG }}
|
||||
run: |
|
||||
mkdir -p ~/.kube
|
||||
echo "$KUBECONFIG_DATA" | base64 -d > ~/.kube/config
|
||||
|
||||
# Appliquer les manifests (idempotent)
|
||||
kubectl apply -f deploy/k8s/namespace.yaml
|
||||
kubectl apply -f deploy/k8s/pwa.deployment.yaml
|
||||
kubectl apply -f deploy/k8s/api.deployment.yaml
|
||||
|
||||
# Pull secret (idempotent)
|
||||
kubectl -n ordinarthur-os create secret docker-registry gitea-registry \
|
||||
--docker-server=git.arthurbarre.fr \
|
||||
--docker-username=ordinarthur \
|
||||
--docker-password="${{ secrets.REGISTRY_PASSWORD }}" \
|
||||
--dry-run=client -o yaml | kubectl apply -f -
|
||||
|
||||
# Rollout
|
||||
kubectl -n ordinarthur-os set image deploy/api api=$API_TAG
|
||||
kubectl -n ordinarthur-os set image deploy/pwa pwa=$PWA_TAG
|
||||
kubectl -n ordinarthur-os rollout status deploy/api --timeout=120s
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user