add Forgejo Actions CI/CD workflow
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 32s
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 32s
This commit is contained in:
parent
26ba20c55e
commit
9613c62803
1 changed files with 31 additions and 0 deletions
31
.forgejo/workflows/build-and-deploy.yaml
Normal file
31
.forgejo/workflows/build-and-deploy.yaml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
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
|
||||
Loading…
Reference in a new issue