From 55655edec41a2384f3f1699dbd0dfca88b43a8b4 Mon Sep 17 00:00:00 2001 From: Bernt Date: Sat, 8 Aug 2026 13:13:01 +0000 Subject: [PATCH] feat: Add CI/CD pipeline, versioning and changelog - Gitea Actions workflow for build and deploy - VERSION file (1.0.0) - CHANGELOG.md - Automatic ECR push on commit - Automatic EKS deployment on main branch --- .gitea/workflows/deploy.yml | 76 +++++++++++++++++++++++++++++++++++++ CHANGELOG.md | 22 +++++++++++ VERSION | 1 + 3 files changed, 99 insertions(+) create mode 100644 .gitea/workflows/deploy.yml create mode 100644 CHANGELOG.md create mode 100644 VERSION diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..bae3f58 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,76 @@ +name: ALVA Deploy + +on: + push: + branches: [main, master] + tags: ['v*'] + pull_request: + branches: [main, master] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: eu-north-1 + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v2 + + - name: Build and push webb image + working-directory: felsokning/app + run: | + # Kopiera gemensam-moduler + mkdir -p services + cp -r ../services/gemensam services/ + + # Bygg image + docker build \ + --build-arg VITE_SUPABASE_URL="${{ secrets.VITE_SUPABASE_URL }}" \ + --build-arg VITE_SUPABASE_PUBLISHABLE_KEY="${{ secrets.VITE_SUPABASE_PUBLISHABLE_KEY }}" \ + --build-arg VITE_AI_ORKESTER_URL="https://ai.alva.landvex.com" \ + --build-arg VITE_PLATTFORM_URL="https://api.alva.landvex.com" \ + -t ${{ steps.login-ecr.outputs.registry }}/alva-webb:${{ github.sha }} \ + -t ${{ steps.login-ecr.outputs.registry }}/alva-webb:latest \ + . + + docker push ${{ steps.login-ecr.outputs.registry }}/alva-webb:${{ github.sha }} + docker push ${{ steps.login-ecr.outputs.registry }}/alva-webb:latest + + deploy: + needs: build + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: eu-north-1 + + - name: Update kubeconfig + run: aws eks update-kubeconfig --name landvex-prod --region eu-north-1 + + - name: Deploy to EKS + run: | + kubectl set image deployment/alva-webb \ + webb=${{ steps.login-ecr.outputs.registry }}/alva-webb:${{ github.sha }} \ + -n alva + + kubectl rollout status deployment/alva-webb -n alva --timeout=300s + + - name: Verify deployment + run: | + kubectl get pods -n alva + curl -s https://alva.landvex.com/ | grep -E "" | head -1 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..df16216 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,22 @@ +# Changelog + +## [1.0.0] - 2026-08-08 + +### Added +- Initial production deployment +- CloudFront CDN with SSL +- EKS deployment with 2 replicas +- RDS PostgreSQL database +- Git-based CI/CD pipeline + +### Infrastructure +- Kubernetes namespace: `alva` +- Node group: `alva-arm64` (2× t4g.medium) +- CloudFront distribution +- ACM SSL certificate +- Route53 DNS + +### Services +- `alva-webb` - Webbklient (React/Vite SPA) +- `alva-plattform` - Backend API +- `alva-ai-orkester` - AI-tjänst diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..3eefcb9 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.0.0