Some checks failed
Django Helm GitOps Deploy / build-and-deploy (push) Failing after 54s
55 lines
1.9 KiB
YAML
55 lines
1.9 KiB
YAML
name: Django Helm GitOps Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
container: catthehacker/ubuntu:act-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
|
|
# DER INSTALLATIONS-/AKTIVIERUNGSSCHRITT IST ENTFERNT!
|
|
# Terraform steht durch das Runner-Volume sofort global bereit.
|
|
|
|
- name: Trust Local Nginx Certificate Inside Container
|
|
run: |
|
|
mkdir -p /usr/local/share/ca-certificates/
|
|
cp nginx_ssl/nginx.crt /usr/local/share/ca-certificates/nginx-sandbox.crt 2>/dev/null || echo "Nutze Workspace-Zertifikat"
|
|
update-ca-certificates
|
|
|
|
- name: Log in to Local Registry
|
|
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login localhost:3005 -u ${{ github.actor }} --password-stdin
|
|
|
|
- name: Build Django Image
|
|
run: |
|
|
docker build -t registry.local/bast/boday-it-web:${{ github.sha }} .
|
|
docker build -t registry.local/bast/boday-it-web:latest .
|
|
|
|
- name: Push Django Image
|
|
run: |
|
|
docker push registry.local/bast/boday-it-web:${{ github.sha }}
|
|
docker push registry.local/bast/boday-it-web:latest
|
|
|
|
- name: Prepare Kubernetes Access
|
|
run: |
|
|
echo "${{ secrets.KUBECONFIG_DATA }}" > ./kind_kubeconfig
|
|
chmod 600 ./kind_kubeconfig
|
|
|
|
- name: Terraform Deploy
|
|
run: |
|
|
# Führt direkt das installierte Zentral-Binary aus!
|
|
terraform --version
|
|
terraform init
|
|
terraform apply -auto-approve -var="app_version=${{ github.sha }}"
|
|
|
|
- name: Verify App Health
|
|
run: |
|
|
echo "Warte auf die Django-Pods und das Ingress-Routing..."
|
|
sleep 20
|
|
curl --fail --connect-timeout 5 http://local-k3s-platform:80/ || exit 1
|
|
echo "Erfolg: Die Boday-IT Django-Webseite läuft perfekt via Helm!"
|