Major Changes: - Migrate UI to Shadcn components with Tailwind CSS v3 - Implement dark theme as default with improved color scheme - Optimize homepage layout to fit single screen without scrolling - Fix chart visibility with explicit colors for dark mode Deployment Infrastructure: - Add Docker multi-stage build with Nginx + Node.js - Create Kubernetes manifests (deployment, service, ingress, PVC) - Configure Gitea CI/CD workflow with registry integration - Add deployment scripts with registry support CI/CD Configuration: - Registry: gitea.vidoks.fr/sortifal/pfee - Automatic build and push on commits - Kubernetes deployment with image pull secrets - Three-stage pipeline: build, deploy, notify Documentation: - Add DEPLOYMENT.md with comprehensive deployment guide - Add SETUP-REGISTRY.md with step-by-step registry setup - Add workflow README with troubleshooting guide - Include configuration examples and best practices 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Gitea CI/CD Workflow
This directory contains the Gitea Actions workflow for building and deploying the SQDC Dashboard.
Workflow: build-deploy.yml
Triggers
- Push to
mainordashboardbranches - Pull Request to
mainordashboardbranches
Jobs
1. Build Job
Runs on every push and pull request.
Steps:
- Checkout code
- Set up Node.js 18
- Install dependencies (
npm ci) - Run tests
- Build React application
- Login to container registry
- Build Docker image
- Tag image with commit SHA and
latest - Push to registry:
gitea.vidoks.fr/sortifal/pfee
Artifacts:
- Docker image pushed to registry with tags:
gitea.vidoks.fr/sortifal/pfee:<commit-sha>gitea.vidoks.fr/sortifal/pfee:latest
2. Deploy Job
Runs only on push to main or dashboard branches (not on PRs).
Steps:
- Checkout code
- Set up kubectl
- Configure kubectl with k3s config
- Create registry credentials secret
- Apply Kubernetes manifests (namespace, deployment, service, ingress)
- Update deployment with new image
- Wait for rollout to complete
- Verify deployment status
Requirements:
- Successful build job
- Push to protected branches only
3. Notify Job
Runs after build and deploy jobs complete (success or failure).
Steps:
- Check deployment result
- Display success or failure message
- Exit with error code if deployment failed
Required Secrets
Configure these in Gitea repository settings:
| Secret | Description |
|---|---|
KUBE_CONFIG |
Plain text kubeconfig for k3s cluster |
REGISTRY_URL |
Container registry URL (gitea.vidoks.fr) |
REGISTRY_USER |
Registry username |
REGISTRY_PASSWORD |
Registry password or access token |
Workflow Behavior
On Pull Request
- Builds and tests the code
- Pushes image to registry
- Does not deploy to Kubernetes
On Push to main/dashboard
- Builds and tests the code
- Pushes image to registry
- Deploys to Kubernetes cluster
- Updates running deployment with new image
- Verifies deployment success
Image Versioning
Each build creates two image tags:
-
Commit SHA tag:
gitea.vidoks.fr/sortifal/pfee:<commit-sha>- Immutable, specific version
- Used for rollbacks
-
Latest tag:
gitea.vidoks.fr/sortifal/pfee:latest- Points to most recent build
- Used by default in deployment
Monitoring
View Workflow Runs
- Go to repository on Gitea
- Click "Actions" tab
- Select workflow run to view logs
Check Deployment Status
# View all resources
kubectl get all -n sqdc-dashboard
# View deployment status
kubectl rollout status deployment/sqdc-dashboard -n sqdc-dashboard
# View pod logs
kubectl logs -f deployment/sqdc-dashboard -n sqdc-dashboard
Troubleshooting
Build Failures
Tests failing:
# Run tests locally
npm test
Build errors:
# Run build locally
npm run build
Registry Push Failures
Authentication errors:
- Verify
REGISTRY_USERandREGISTRY_PASSWORDare correct - Ensure token has
write:packagepermission
Network errors:
- Check registry URL is accessible:
gitea.vidoks.fr
Deployment Failures
kubectl connection errors:
- Verify
KUBE_CONFIGis valid and not base64 encoded - Test locally:
kubectl get nodes
Image pull errors:
- Check registry credentials secret exists
- Verify image was pushed successfully
Rollout timeout:
- Increase timeout in workflow (default: 5m)
- Check pod logs for errors
Manual Operations
Manual Deploy
# Using the deploy script
./scripts/deploy.sh gitea.vidoks.fr <user> <password> sortifal/pfee
# Or manually with kubectl
kubectl apply -f k8s/
kubectl set image deployment/sqdc-dashboard dashboard=gitea.vidoks.fr/sortifal/pfee:latest -n sqdc-dashboard
Rollback
# Using the rollback script
./scripts/rollback.sh
# Or manually
kubectl rollout undo deployment/sqdc-dashboard -n sqdc-dashboard
Skip Workflow
Add [skip ci] to commit message:
git commit -m "docs: Update README [skip ci]"
Customization
Change Deployment Conditions
Edit the if condition in deploy job:
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dashboard'
Add Slack/Email Notifications
Add steps in notify job to send alerts.
Add More Tests
Add test steps in build job:
- name: Run linter
run: npm run lint
- name: Run integration tests
run: npm run test:integration
For more details, see DEPLOYMENT.md and SETUP-REGISTRY.md.