CI/CD Pipelines
OpenCodeHub includes a built-in CI/CD pipeline engine that reads workflow definitions from .github/workflows/*.yml files in your repository.
Supported Features
Section titled “Supported Features”- GitHub Actions-compatible syntax — familiar
jobs,steps,runs-on, anduses - Docker-based execution — every job runs in an isolated container
- Matrix builds — test across multiple versions or configurations
- Secrets management — encrypted repository and organization secrets
- Artifact storage — upload and download build artifacts
- Caching — cache dependencies between runs
- Self-hosted runners — run jobs on your own infrastructure
Quick Start
Section titled “Quick Start”1. Create a Workflow File
Section titled “1. Create a Workflow File”Add .github/workflows/ci.yml to your repository:
name: CI
on: push: branches: [main] pull_request: branches: [main]
jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '20' - name: Install dependencies run: npm ci - name: Run tests run: npm test2. Push and Watch
Section titled “2. Push and Watch”Push the file to OpenCodeHub. The workflow is automatically detected and a run is triggered.
Runner Configuration
Section titled “Runner Configuration”In-App Runner
Section titled “In-App Runner”npm run runner:startDocker Runner (Recommended)
Section titled “Docker Runner (Recommended)”services: runner: build: context: . dockerfile: Dockerfile.runner privileged: true environment: SERVER_URL: https://git.yourcompany.com RUNNER_TOKEN: <from-admin-panel>Status Checks & Branch Protection
Section titled “Status Checks & Branch Protection”Require CI to pass before merging:
- Go to Repository → Settings → Branches
- Add protection rule for
main - Enable Require status checks to pass
- Select your workflow name
Monitoring Pipeline Runs
Section titled “Monitoring Pipeline Runs”Web UI
Section titled “Web UI”Repository → Actions shows run history, step-by-step logs, and artifacts.
och actions listoch actions logs <run-id>och actions cancel <run-id>curl https://git.yourcompany.com/api/repos/owner/repo/actions/runs \ -H "Authorization: Bearer $TOKEN"Best Practices
Section titled “Best Practices”- Run lint and unit tests first (fast), integration tests after (slower)
- Use caching for dependencies
- Cancel redundant runs on new pushes
- Use
pathsfilters to avoid unnecessary builds