LabsApplicationStack is a comprehensive workflow stack designed for the common Penn Labs architecture: a Django backend and React frontend. It orchestrates the entire CI/CD pipeline from code quality checks to production deployment.
Overview
TheLabsApplicationStack creates a complete GitHub Actions workflow that:
- Lints and tests both Django and React projects
- Builds and publishes Docker images
- Optionally runs integration tests
- Deploys to production on the default branch
{dockerImageBaseName}-backend and {dockerImageBaseName}-frontend.
Constructor
Parameters
The cdkactions App instance that serves as the parent scope.
Configuration object for the stack.
Name of the Django project to test and build.
Base name for Docker images. Will publish
{base}-backend and {base}-frontend images.Path to the Django project directory within the repository.
Path to the React project directory within the repository.
If true, runs integration tests using docker-compose before deploying.
Optional props to customize the Django check job.
Optional overrides for the Django check job configuration.
Optional props to customize the Django Docker publish job.
Optional overrides for the Django Docker publish job configuration.
Optional props to customize the React check job.
Optional overrides for the React check job configuration.
Optional props to customize the React Docker publish job.
Optional overrides for the React Docker publish job configuration.
Optional props to customize the integration tests job.
Optional overrides for the integration tests job configuration.
Optional props to customize the deploy job.
Optional overrides for the deploy job configuration.
Optional overrides for the workflow itself (name, triggers, etc.).
Basic Usage
The simplest configuration for a standard Django + React project:- Checks out code
- Runs Django linting and tests in
backend/ - Runs React linting and tests in
frontend/ - Builds and publishes
example-product-backendDocker image - Builds and publishes
example-product-frontendDocker image - Deploys to production (on master branch only)
Advanced Usage
Custom Paths
If your project structure differs from the defaults:With Integration Tests
Enable integration tests that run after building Docker images:Custom Job Configuration
Customize individual jobs within the stack:Generated Workflow
The stack generates a GitHub Actions workflow with the following job dependency graph:Without Integration Tests
With Integration Tests
integrationTests is enabled, Docker images are built but not published until integration tests pass. This ensures only validated images reach the registry.
See Also
- DjangoProject - Standalone Django workflow
- ReactProject - Standalone React workflow
- DeployJob - Deployment job details