Concept Flow - CI/CD pipeline setup
Code Commit
Trigger Pipeline
Run Tests
Build
Deploy
Notify Success
This flow shows how code commits trigger the pipeline, run tests, build, deploy, and notify based on results.
steps:
- name: Run Tests
run: deno test
- name: Build
run: deno bundle main.ts bundle.js
- name: Deploy
run: ./deploy.sh| Step | Action | Command Run | Result | Next Step |
|---|---|---|---|---|
| 1 | Trigger pipeline on commit | N/A | Pipeline started | Run Tests |
| 2 | Run Tests | deno test | All tests passed | Build |
| 3 | Build | deno bundle main.ts bundle.js | Bundle created | Deploy |
| 4 | Deploy | ./deploy.sh | Deployment successful | Notify Success |
| 5 | Notify Success | N/A | Team notified of success | End |
| Variable | Start | After Step 2 | After Step 3 | After Step 4 | Final |
|---|---|---|---|---|---|
| pipeline_status | not started | tests passed | build done | deployed | success notified |
| test_result | none | pass | pass | pass | pass |
| build_artifact | none | none | bundle.js created | bundle.js deployed | bundle.js deployed |
CI/CD pipeline setup: - Triggered by code commit - Runs tests first (deno test) - Builds bundle if tests pass (deno bundle) - Deploys app if build succeeds - Notifies team on success or failure - Stops pipeline on test or build failure
deno test.steps:
- name: Run tests
run: deno test --unstable
- name: Bundle code
run: deno bundle mod.ts bundle.jsdeno test --unstable fails, the next step to bundle code will not run.steps:
- name: Bundle code
run: deno bundle mod.ts -o bundle.jsdeno bundle input.ts output.js without '-o' flag.Pass the test and this pattern moves unknown