This project demonstrates Continuous Integration and Continuous Deployment (CI/CD) for an Angular application. It includes GitHub Actions for automated testing and deployment to Vercel.
- Branch
new-feature: Add new features to the Angular application. - GitHub Workflow: Set up for automated testing and deployment.
- Deployment: The application is deployed to Vercel.
- New Feature: Implemented and tested in the
new-featurebranch. - GitHub Actions: Automated CI/CD pipeline for building, testing, and deploying the application.
- Deployment: Continuous deployment to Vercel.
The workflow defined in .github/workflows/preview.yaml handles preview deployments for non-main branches. It includes:
-
Test:
- Runs on:
ubuntu-latest - Checkout: Uses
actions/checkout@v3to fetch the repository. - Setup Node.js: Uses
actions/setup-node@v3with Node.js version 18. - Install Dependencies: Runs
npm ci. - Run Tests: Executes
npm run test:prod.
- Runs on:
-
Deploy-Preview:
- Depends on:
Test - Runs on:
ubuntu-latest - Checkout: Uses
actions/checkout@v3to fetch the repository. - Install Vercel CLI: Installs Vercel CLI globally.
- Pull Vercel Environment Information: Uses
vercel pullwith the preview environment. - Build Project Artifacts: Uses
vercel buildto build the project. - Deploy Project Artifacts: Uses
vercel deployto deploy the built project.
- Depends on:
The workflow defined in .github/workflows/production.yaml handles production deployments for the main branch. It includes:
- Deploy-Production:
- Runs on:
ubuntu-latest - Checkout: Uses
actions/checkout@v3to fetch the repository. - Install Vercel CLI: Installs Vercel CLI globally.
- Pull Vercel Environment Information: Uses
vercel pullwith the production environment. - Build Project Artifacts: Uses
vercel buildwith the--prodflag. - Deploy Project Artifacts: Uses
vercel deploywith the--prodflag to deploy the project.
- Runs on:
The application is automatically deployed to Vercel:
- Preview Deployments: Triggered for branches other than
main. - Production Deployments: Triggered for the
mainbranch.
You can view the live application here.
main: The main branch with the latest stable code.new-feature: Contains the new feature implementation. Merged into themainbranch after successful testing.
Tests are automatically run as part of the CI/CD pipeline. Ensure all tests pass before merging changes to the main branch.