This document describes the Continuous Integration and Continuous Deployment (CI/CD) setup for Mostage Studio using GitHub Actions.
The project uses GitHub Actions for automated testing, building, and deployment. There are three main CI workflows:
- CI Frontend Workflow - Runs on frontend changes
- CI Backend Workflow - Runs on backend changes
- CI Infrastructure Workflow - Runs on infrastructure changes
Note: Infrastructure deployment is performed manually using AWS CDK commands locally. Frontend deployment is handled by AWS Amplify (see amplify.yml). See Infrastructure Setup for deployment instructions.
Purpose: Automated code quality checks and validation for frontend
Triggers:
- Push to
mainordevbranches only when files infrontend/change - Pull requests to
mainordevbranches only when files infrontend/change
Jobs:
- Lint: Runs ESLint to check code quality
- Type Check: Validates TypeScript types
- Build: Tests if the project builds successfully
Location: .github/workflows/ci-frontend.yml
Purpose: Automated validation for infrastructure code
Triggers:
- Push to
mainordevbranches only when files ininfrastructure/change - Pull requests to
mainordevbranches only when files ininfrastructure/change
Jobs:
- Build: Compiles TypeScript to JavaScript
- Type Check: Validates TypeScript types
Location: .github/workflows/ci-infrastructure.yml
Purpose: Automated validation for backend Lambda functions
Triggers:
- Push to
mainordevbranches only when files inbackend/change - Pull requests to
mainordevbranches only when files inbackend/change
Jobs:
- Build: Compiles TypeScript to JavaScript
- Type Check: Validates TypeScript types
Location: .github/workflows/ci-backend.yml
Currently, no GitHub Secrets are required for CI workflows. Environment variables for frontend builds are handled by AWS Amplify (see amplify.yml).
.github/workflows/
├── ci-frontend.yml # Frontend CI checks (lint, type-check, build)
├── ci-backend.yml # Backend CI checks (build, type-check)
└── ci-infrastructure.yml # Infrastructure CI checks (build, type-check)
Note: Frontend deployment is handled by AWS Amplify (see amplify.yml in the root directory).
CI checks run automatically on:
- Frontend CI: When files in
frontend/change - Backend CI: When files in
backend/change - Infrastructure CI: When files in
infrastructure/change
You can also manually trigger from Actions → CI Frontend, Actions → CI Backend, or Actions → CI Infrastructure
Frontend deployment is handled by AWS Amplify. See amplify.yml in the root directory for configuration.
Infrastructure deployment is performed manually using AWS CDK commands locally. This ensures better control and security.
For Development:
cd infrastructure
npm install
npm run build
npm run diff:dev
npm run deploy:devFor Production:
cd infrastructure
npm install
npm run build
npm run diff:prod
npm run deploy:prodImportant:
- Always review the diff before deploying
- Each environment has separate stacks and resources
- Users in dev and prod are completely isolated
- After deployment, update GitHub Secrets with new Cognito IDs if they changed
See Infrastructure Setup for detailed instructions.
Lint errors:
- Check ESLint output in Actions logs
- Fix linting issues locally:
cd frontend && npm run lint
Type check errors:
- Check TypeScript errors in Actions logs
- Fix type errors locally:
cd frontend && npx tsc --noEmit
Build errors:
- Check build logs in Actions
- Test build locally:
cd frontend && npm run build
CDK build errors:
- Check build output in Actions logs
- Build locally:
cd infrastructure && npm run build
TypeScript type errors:
- Check type check output in Actions logs
- Type check locally:
cd infrastructure && npx tsc --noEmit
Build errors:
- Check build output in Actions logs
- Build locally:
cd backend && npm run build
TypeScript type errors:
- Check type check output in Actions logs
- Type check locally:
cd backend && npx tsc --noEmit
-
Always run CI locally before pushing:
# Frontend cd frontend && npm run lint && npx tsc --noEmit && npm run build # Backend cd backend && npm run build && npx tsc --noEmit # Infrastructure cd infrastructure && npm run build && npx tsc --noEmit
-
Review CI results before merging PRs
-
Test infrastructure changes locally before deploying:
cd infrastructure && npm run build && npm run diff:dev
-
Always review CDK diff before deploying changes
-
Update GitHub Secrets after infrastructure deployment if Cognito IDs changed
- Infrastructure deployment is performed manually locally to prevent accidental changes
- AWS credentials are configured locally using
aws configure - Always review CDK diff before deploying changes
- IAM user should have minimal required permissions (see Infrastructure Setup)
- Infrastructure Setup - AWS CDK setup and IAM policies
- Authentication Setup - Cognito configuration
- Project Structure - Project architecture