fix: 1
Some checks failed
CI/CD Pipeline / build (push) Failing after 38s
CI/CD Pipeline / deploy (push) Has been skipped

This commit is contained in:
2026-04-16 18:17:10 +02:00
parent b097018e54
commit 6331bec703

View File

@@ -1,3 +1,4 @@
# .gitea/workflows/ci.yml
name: CI/CD Pipeline
on:
@@ -9,12 +10,10 @@ env:
IMAGE: git.fpmoz.sum.ba/${{ github.repository }}
jobs:
# ── JOB 1: Build i Push Docker image ──────────────────
build:
runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- name: Checkout koda
uses: actions/checkout@v4
@@ -22,7 +21,7 @@ jobs:
run: |
echo ${{ secrets.REGISTRY_PASS }} | \
docker login $REGISTRY \
-u ${{ secrets.REGISTRY_USER }} --stdin
-u ${{ secrets.REGISTRY_USER }} --password-stdin
- name: Build i Push image
run: |
@@ -33,24 +32,30 @@ jobs:
echo $TAG > tag.txt
- name: Spremi image tag
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: image-tag
path: tag.txt
# ── JOB 2: Deploy na k3s ───────────────────────────────
deploy:
needs: build
runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- name: Checkout koda
uses: actions/checkout@v4
- name: Preuzmi image tag
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: image-tag
- name: Instaliraj kubectl
run: |
curl -LO "https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
mv kubectl /usr/local/bin/
- name: Postavi kubeconfig
run: |
mkdir -p ~/.kube
@@ -64,7 +69,7 @@ jobs:
- name: Deploy na k3s
run: |
kubectl apply -f k8s/
kubectl create namespace student-${{ github.actor }} --dry-run=client -o yaml | kubectl apply -f -
kubectl apply -f k8s/ -n student-${{ github.actor }}
kubectl rollout status deployment/hello-cicd \
-n student-${{ github.actor }} --timeout=120s