Files
API/.gitea/workflows/main.yml
zomborip a5ea0dfdd7
All checks were successful
Build and Push API / build-and-push (push) Successful in 8s
CD Update
2025-11-24 21:40:16 +01:00

56 lines
1.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: Build and Push API
on:
push:
branches:
- master
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# Smoke test csak ellenőrizzük, hogy látjuk a docker socketet
- name: Docker smoke test
run: docker ps -a
# docker login itt majd a repó Secretjeit fogjuk használni
- name: Docker login
run: |
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login git.petyi.eu -u "${{ secrets.REGISTRY_USER }}" --password-stdin
# docker build egyszerűen latest taggel
- name: Docker build
run: |
docker build -t git.petyi.eu/szakdolgozat/api:latest .
# docker push ugyanaz az image
- name: Docker push
run: |
docker push git.petyi.eu/szakdolgozat/api:latest
# Kubeconfig átemelése
- name: Set up kubeconfig
env:
KUBECONFIG: /tmp/kubeconfig
run: |
echo "${{ secrets.KUBECONFIG_B64 }}" | base64 -d > "$KUBECONFIG"
echo "==== KubeConfig ===="
cat "$KUBECONFIG"
# Kubeconfig Smoke test
- name: Kubernetes smoke test
env:
KUBECONFIG: /tmp/kubeconfig
run: |
kubectl get nodes -o wide
# Rollout
- name: Rollout restart API deployment
env:
KUBECONFIG: /tmp/kubeconfig
run: |
kubectl rollout restart deployment/telefonkonyv-api -n szakdolgozat