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

45 lines
1.3 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
# 5. kubeconfig létrehozása a secretből
- name: Set up kubeconfig
run: |
mkdir -p ~/.kube
echo "${{ secrets.KUBECONFIG_B64 }}" | base64 -d > ~/.kube/config
cat ~/.kube/config
# 6. rollout restart az API deploymentre
- name: Rollout restart API deployment
run: |
kubectl rollout restart deployment/telefonkonyv-api -n szakdolgozat