Migration CI GitLab -> Gitea Actions
build-and-deploy / build (push) Successful in 1m9s
build-and-deploy / deploy (push) Successful in 4s

This commit is contained in:
2026-07-09 20:53:01 +02:00
parent 3460b67777
commit 189d8cf92e
2 changed files with 44 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
stages:
- build
- deploy
variables:
DOCKER_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
DOCKER_IMAGE_LATEST: $CI_REGISTRY_IMAGE:latest
build:
stage: build
image: docker:24
services:
- docker:24-dind
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- docker build -t $DOCKER_IMAGE -t $DOCKER_IMAGE_LATEST .
- docker push $DOCKER_IMAGE
- docker push $DOCKER_IMAGE_LATEST
only:
- main
- master
deploy:
stage: deploy
image: dtzar/helm-kubectl:latest
before_script:
- mkdir -p ~/.kube
- echo "$KUBE_CONFIG" | base64 -d > ~/.kube/config
- chmod 600 ~/.kube/config
script:
- echo "🚀 Déploiement du Portfolio..."
- kubectl apply -f k8s.yaml
- kubectl rollout restart deployment/portfolio-app -n portfolio-ns
- echo "✅ Déploiement terminé sur https://portfolio.valentin-massonniere.ch"
only:
- main
- master