avisenna-landing-page/.forgejo/workflows/build-and-deploy.yaml
kebrahimpour 9613c62803
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 32s
add Forgejo Actions CI/CD workflow
2026-03-27 23:00:51 +01:00

31 lines
723 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
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