$npx -y skills add omnigentx/jarvis --skill cicd-pipelineCI/CD pipeline design and configuration. Use when a DSO needs to set up GitHub Actions, automated testing, or deployment workflows.
| 1 | # CI/CD PIPELINE |
| 2 | |
| 3 | ## GitHub Actions Workflow Template |
| 4 | |
| 5 | ```yaml |
| 6 | name: CI/CD Pipeline |
| 7 | on: |
| 8 | push: |
| 9 | branches: [main, develop] |
| 10 | pull_request: |
| 11 | branches: [main] |
| 12 | |
| 13 | jobs: |
| 14 | test: |
| 15 | runs-on: ubuntu-latest |
| 16 | steps: |
| 17 | - uses: actions/checkout@v4 |
| 18 | - name: Set up Python |
| 19 | uses: actions/setup-python@v5 |
| 20 | with: |
| 21 | python-version: '3.12' |
| 22 | - name: Install dependencies |
| 23 | run: pip install -r requirements.txt |
| 24 | - name: Run tests |
| 25 | run: pytest --cov=./ --cov-report=xml |
| 26 | |
| 27 | lint: |
| 28 | runs-on: ubuntu-latest |
| 29 | steps: |
| 30 | - uses: actions/checkout@v4 |
| 31 | - name: Lint |
| 32 | run: | |
| 33 | pip install ruff |
| 34 | ruff check . |
| 35 | |
| 36 | build: |
| 37 | needs: [test, lint] |
| 38 | runs-on: ubuntu-latest |
| 39 | steps: |
| 40 | - uses: actions/checkout@v4 |
| 41 | - name: Build Docker |
| 42 | run: docker compose build |
| 43 | ``` |
| 44 | |
| 45 | ## Pipeline Stages |
| 46 | ``` |
| 47 | Push → Lint → Test → Build → Deploy (staging) → Approval → Deploy (prod) |
| 48 | ``` |
| 49 | |
| 50 | ## Security rules |
| 51 | - ❌ DO NOT hardcode secrets in source. |
| 52 | - ✅ Use GitHub Secrets for API keys. |
| 53 | - ✅ Scan dependencies for vulnerabilities. |
| 54 | - ✅ Scan Docker images before deploying. |
| 55 | |
| 56 | ## Deployment |
| 57 | - Staging: auto-deploy on `develop` branch |
| 58 | - Production: manual approval required |
| 59 | - Rollback: keep 3 previous versions |