Angular › Build, Environments & Deployment
How would you set up a continuous deployment pipeline for an Angular project?
AdvancedAnswer
A continuous deployment pipeline automatically runs your tests, builds your app, and deploys it to a live server every time new code is pushed to your repository, without anyone needing to do it manually. This catches mistakes early through automated tests and makes shipping new features fast and reliable.
# A simplified GitHub Actions workflow for an Angular app
name: Deploy
on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm install
- run: npm test -- --watch=false
- run: npm run build -- --configuration production
- run: firebase deployReal-world example A team sets up a pipeline so that every time a developer merges new code, the tests run automatically, and if everything passes, the site deploys to production within a few minutes without anyone touching a keyboard.