From 9613c62803c3f7d0d61a331b278513368bccb22f Mon Sep 17 00:00:00 2001 From: kebrahimpour Date: Fri, 27 Mar 2026 23:00:51 +0100 Subject: [PATCH] add Forgejo Actions CI/CD workflow --- .forgejo/workflows/build-and-deploy.yaml | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .forgejo/workflows/build-and-deploy.yaml diff --git a/.forgejo/workflows/build-and-deploy.yaml b/.forgejo/workflows/build-and-deploy.yaml new file mode 100644 index 0000000..29c4a10 --- /dev/null +++ b/.forgejo/workflows/build-and-deploy.yaml @@ -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