avisenna-landing-page/.forgejo/workflows/build-and-deploy.yaml
kebrahimpour 250da90bd3
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 19s
ci: use custom ci-runner container image with docker+kubectl
2026-03-27 23:24:17 +01:00

38 lines
989 B
YAML

name: Build and Deploy
on:
push:
branches:
- main
- dev
- 'feat/**'
- 'test/**'
- 'fix/**'
- 'hotfix/**'
env:
IMAGE: git.avisenna-engineering.de/keyvan/avisenna-landing-page
VERSION: latest
NAMESPACE: ${{ github.ref == 'refs/heads/main' && 'prod' || 'web' }}
jobs:
build-and-deploy:
runs-on: ubuntu-latest
container:
image: git.avisenna-engineering.de/keyvan/ci-runner:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /etc/rancher/k3s/k3s.yaml:/etc/rancher/k3s/k3s.yaml
env:
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t $IMAGE:$VERSION .
- name: Deploy to Kubernetes
run: |
kubectl set image deployment/homepage homepage=$IMAGE:$VERSION -n $NAMESPACE
kubectl rollout restart deployment/homepage -n $NAMESPACE