Files
API/.gitea/workflows/main.yml
Zombori Péter caed5c6b2e
Some checks failed
Build and Push API / build-and-push (push) Failing after 6s
CD: Kube
2025-11-17 16:31:10 +01:00

53 lines
1.4 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
# 1. Smoke test csak ellenőrizzük, hogy látjuk a docker socketet
- name: Docker smoke test
run: docker ps -a
# 2. 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
# 3. docker build egyszerűen latest taggel
- name: Docker build
run: |
docker build -t git.petyi.eu/szakdolgozat/api:latest .
# 4. docker push ugyanaz az image
- name: Docker push
run: |
docker push git.petyi.eu/szakdolgozat/api:latest
- name: Set up kubeconfig
env:
KUBECONFIG: /tmp/kubeconfig
run: |
echo "${{ secrets.KUBECONFIG_B64 }}" | base64 -d > "$KUBECONFIG"
echo "==== kubeconfig ===="
cat "$KUBECONFIG"
- name: Kubernetes smoke test
env:
KUBECONFIG: /tmp/kubeconfig
run: |
kubectl get nodes -o wide
- name: Rollout restart API deployment
env:
KUBECONFIG: /tmp/kubeconfig
run: |
kubectl rollout restart deployment/telefonkonyv-api -n szakdolgozat