name: Deploy to Production on: push: branches: - main paths: - 'services/iam-service-net/**' - 'apps/web-client/**' - 'deployments/production/**' workflow_dispatch: jobs: deploy: runs-on: ubuntu-latest environment: production steps: - uses: actions/checkout@v4 - name: Setup .NET SDK uses: actions/setup-dotnet@v4 with: dotnet-version: '10.0.x' - name: Run database migrations run: | dotnet tool install --global dotnet-ef || true dotnet ef database update \ --project services/iam-service-net/src/IamService.Infrastructure/IamService.Infrastructure.csproj \ --startup-project services/iam-service-net/src/IamService.API/IamService.API.csproj env: ConnectionStrings__DefaultConnection: ${{ secrets.NEON_DATABASE_URL_PRODUCTION }} - name: Setup kubectl uses: azure/setup-kubectl@v3 - name: Configure kubectl run: | echo "${{ secrets.KUBECONFIG_PRODUCTION }}" | base64 -d > kubeconfig export KUBECONFIG=./kubeconfig - name: Deploy IAM Service run: | export KUBECONFIG=./kubeconfig kubectl apply -f deployments/production/kubernetes/iam-service.yaml kubectl apply -f deployments/production/kubernetes/iam-service-configmap.yaml kubectl apply -f deployments/production/kubernetes/ingress.yaml kubectl rollout status deployment/iam-service -n production - name: Deploy Web App run: | export KUBECONFIG=./kubeconfig kubectl apply -f deployments/production/kubernetes/web-app.yaml || echo "Web app deployment not configured" kubectl rollout status deployment/web-app -n production || echo "Web app deployment not configured"