29 lines
1.0 KiB
YAML
29 lines
1.0 KiB
YAML
name: CI/CD Pipeline
|
|
on: [push]
|
|
jobs:
|
|
pipeline-execution:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Configuration de Buildx pour autoriser le registre local
|
|
uses: docker/setup-buildx-action@v2
|
|
with:
|
|
config-inline: |
|
|
[registry."registry-service.container-registry.svc.cluster.local:5000"]
|
|
http = true
|
|
insecure = true
|
|
|
|
- name: Compiler et Envoyer au registre privé
|
|
run: |
|
|
docker buildx build --push -t registry-service.container-registry.svc.cluster.local:5000/apps/microservice-sample:latest .
|
|
|
|
- name: Installer Kubectl
|
|
run: |
|
|
curl -sLO https://dl.k8s.io/release/v1.30.0/bin/linux/amd64/kubectl
|
|
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
|
|
|
|
- name: Déployer sur Kubernetes
|
|
run: |
|
|
kubectl apply -f k8s-deployment.yaml
|
|
kubectl rollout restart deployment/microservice-sample |