CI/CD Pipelines
Relevant source files
The following files were used as context for generating this wiki page:
The CI/CD pipelines in the fikak_app project are designed to automate the build, testing, and deployment processes for both the frontend and backend components. This automation ensures that code changes are consistently integrated and delivered to production environments, specifically targeting Azure App Service.
The project utilizes GitHub Actions as the primary orchestration tool for CI/CD, managing the lifecycle of the application from code commit to cloud deployment.
Pipeline Architecture
The pipeline is structured to handle the multi-tier nature of the application, which consists of a Python-based backend and a Node.js-based frontend.
Workflow Orchestration
The primary workflow is triggered by pushes to the main branch or manual triggers. It involves building the application artifacts and deploying them to an Azure Web App.
Build and Deployment Stages
The pipeline is divided into two major jobs: build and deploy.
| Job | Purpose | Key Actions |
|---|---|---|
| build | Prepare the application environment and artifacts | Python setup, dependency installation, artifact compression |
| deploy | Transfer artifacts to the production environment | Download artifacts, Azure Login, Web App deployment |
Sources: .github/workflows/main_fikak.yml:10-55
Backend CI/CD Integration
The backend is a Python application that requires specific environmental setup during the CI process. The pipeline ensures that the correct Python version is used and all dependencies are resolved before deployment.
Backend Dependency Management
The pipeline installs dependencies listed in the requirements file to ensure the build environment matches the runtime environment.
Frontend CI/CD Integration
The frontend, managed via npm, is integrated into the project structure. While the main workflow focuses on the deployment of the integrated app, the project structure supports standard Node.js build scripts.
Frontend Build Scripts
The package.json defines the necessary scripts for development and building that can be invoked during CI processes.
| Script | Command | Description |
|---|---|---|
start | react-scripts start | Starts the development server |
build | react-scripts build | Compiles the production build |
test | react-scripts test | Executes the test suite |
Sources: frontend/package.json:13-16
Deployment Configuration
The deployment phase targets Azure Web Apps, utilizing specific GitHub Actions for authentication and package delivery.
Azure Deployment Flow
The pipeline uses a publish profile or service principal for authentication to push the build artifacts.
Key Configuration Parameters
The deployment job relies on the following environment variables and secrets:
AZURE_WEBAPP_NAME: Name of the target Azure Web App (e.g., "fikak").AZURE_WEBAPP_PACKAGE_PATH: Path to the zip artifact (typically '.').PYTHON_VERSION: Specified as '3.12'.
Sources: .github/workflows/main_fikak.yml:5-15
Containerization and Local CI
For local development and continuous integration in containerized environments, the project includes a docker-compose.yml file. This allows developers to simulate the production environment locally.
Service Definitions
The project defines services for both the backend and frontend, ensuring they can be spun up in a consistent state.
| Service | Context | Port Mapping |
|---|---|---|
backend | ./backend | 8000:8000 |
frontend | ./frontend | 3000:3000 |
Sources: docker-compose.yml:1-25
The CI/CD pipeline for fikak_app provides a robust mechanism for moving code from the repository to Azure, ensuring that both the Python backend and the React frontend are correctly built and deployed.