Concept Flow - CI pipeline setup
Code pushed to repo
Trigger CI pipeline
Install dependencies
Run tests
Build app
Deploy app
Pipeline complete
This flow shows how a CI pipeline starts from code push, runs tests, builds, and deploys if tests pass.
name: CI Pipeline
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm install
- run: npm test
- run: npm run build| Step | Action | Command | Result | Next Step |
|---|---|---|---|---|
| 1 | Trigger pipeline | push event | Pipeline starts | Checkout code |
| 2 | Checkout code | actions/checkout@v3 | Code downloaded | Install dependencies |
| 3 | Install dependencies | npm install | Dependencies installed | Run tests |
| 4 | Run tests | npm test | Tests pass | Build app |
| 5 | Build app | npm run build | Build successful | Deploy app |
| 6 | Deploy app | custom deploy script | App deployed | Pipeline complete |
| 7 | Pipeline complete | - | Success | End |
| Variable | Start | After Step 2 | After Step 3 | After Step 4 | After Step 5 | Final |
|---|---|---|---|---|---|---|
| Code | Not present | Checked out | Checked out | Checked out | Checked out | Checked out |
| Dependencies | Not installed | Not installed | Installed | Installed | Installed | Installed |
| Tests | Not run | Not run | Not run | Passed | Passed | Passed |
| Build | Not built | Not built | Not built | Not built | Built | Built |
| Deployment | Not deployed | Not deployed | Not deployed | Not deployed | Not deployed | Deployed |
CI Pipeline Setup: - Triggered by code push - Steps: checkout -> install -> test -> build -> deploy - Stops if tests fail - Automates code validation and deployment - Ensures only tested code is deployed