Files
dogu/.gitea/workflows/deploy.yaml
gitmuhammedalbayrak 8525527a34
All checks were successful
Harita Build ve Deploy / build-and-deploy (push) Successful in 37s
CD eklentisi - ek.
2025-11-20 16:19:52 +03:00

67 lines
2.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Harita Build ve Deploy
run-name: ${{ gitea.actor }} Harita Build ve Deploy 🚀
on: [push]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
# ⚠️ BURADA DOCKER_HOST TANIMLAMIYORUZ!
# Runner, kendi iç mekanizmasıyla TCP üzerinden otomatik bağlanacaktır (Sizin stabil ayarınız).
steps:
- name: Kodu Çek (Checkout)
uses: actions/checkout@v3
# -----------------------------------------------------------------
# CI KISMI
# -----------------------------------------------------------------
- name: Docker Buildx Kurulumu
uses: docker/setup-buildx-action@v3
- name: Docker Login (Gitea Registry)
uses: docker/login-action@v3
with:
registry: git.konstantiniyye.studio
username: gitea_admin
password: ${{ secrets.REGISTRY_TOKEN }}
# PUSH ADIMI: İmajın kimliğini (digest) çıktı olarak alıyoruz
- name: Docker Build ve Push
id: docker_build
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: git.konstantiniyye.studio/gitea_admin/dogu:latest
cache-from: type=gha
cache-to: type=gha,mode=max
# -----------------------------------------------------------------
# CD KISMI (Düzeltilmiş)
# -----------------------------------------------------------------
- name: Kubectl Binary Kurulumu
# ARM64 uyumlu kubectl'i kurar
run: |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
- name: Kubernetes'e Deploy Et ve Güncelle
run: |
# 1. Kubeconfig içeriğini dosyaya yazar
echo "${{ secrets.KUBE_CONFIG }}" > /tmp/kubeconfig.yaml
# 2. Yeni imaj Digest'ini alır
NEW_IMAGE_DIGEST="git.konstantiniyye.studio/gitea_admin/dogu@${{ steps.docker_build.outputs.digest }}"
# 3. Deployment'ı günceller ve yeniden başlatır
# ⚠️ BURADA İKİ KOMUTA DA TLS KONTROLÜNÜ DEVRE DIŞI BIRAKAN BAYRAĞI EKLİYORUZ
kubectl set image deployment/dogu-haritasi web=${NEW_IMAGE_DIGEST} \
--kubeconfig=/tmp/kubeconfig.yaml -n default \
--insecure-skip-tls-verify
kubectl rollout restart deployment/dogu-haritasi \
--kubeconfig=/tmp/kubeconfig.yaml -n default \
--insecure-skip-tls-verify