CI/CD Pipeline Specification
This document details the Continuous Integration (CI) and Continuous Deployment (CD) workflows for the My Roadmap project.
1. Overview
The project uses GitHub Actions for automated testing and deployment to AWS Amplify.
- CI: Automated linting, type checking, and build verification on every Pull Request.
- CD: Semi-automated deployment strategy. Automatic deployment on merge is disabled to optimize costs and ensure security. Deployment is triggered by schedules or manual actions, requiring administrator approval.
2. Continuous Integration (CI)
Workflow: Next.js CI (.github/workflows/ci.yml)
- Trigger: Pushes to
mainand all Pull Requests targetingmain. - Environment: Node.js 20.x, Ubuntu latest.
Key Steps:
- Dependency Installation: Uses
npm install. To avoid environmental discrepancies between Windows and CI,package-lock.jsonis removed before installation in the pipeline. - Type Check: Runs
npm run typecheckto ensure TypeScript safety. - Lint: Runs
npm run lint(ESLint) to maintain code quality. - Build Verification: Runs
npm run buildto ensure the Next.js application compiles correctly.
3. Continuous Deployment (CD)
The project adopts a Semi-Automated deployment strategy to AWS Amplify.
Workflow: Amplify Deploy (.github/workflows/deploy.yml)
A. Scheduled Deployment
- Schedule: Every Sunday at 23:00 JST (
0 14 * * 0UTC). - Purpose: To provide a regular "Weekly Release" without manual intervention.
B. Manual Deployment
- Trigger:
workflow_dispatch(Manual trigger from GitHub UI). - Requirement: Execution requires an environment with "Admin Approval".
- Log: The reason for deployment is recorded in the GitHub Actions summary.
Deployment Process Logic (amplify.yml)
- Backend: Deploys AWS resources (Auth, Data) using
npx ampx pipeline-deploy. - Frontend: Builds the Next.js application.
- Cache: Node modules and Next.js build cache are preserved to speed up subsequent builds.
4. Future Roadmap
4.1 Automated Notifications (Planned)
Integration with Slack is planned to provide real-time status updates.
- Details: See Issue #63.
- Events: Notifications for CI/CD success and failure.
4.2 Testing Expansion
4.2 Staging Environments
Currently, the project operates on a single main branch. Future iterations may include:
- Preview deployments for Pull Requests.
- A dedicated
developbranch for staging.
5. Security & Credentials
- All AWS credentials and App IDs are stored securely in GitHub Secrets.
- Deployments to the production environment require manual approval from a repository administrator.