CI/CD pipelines
Run tests and deploys from a workflow file in your repository, and read what happened.
Pipelines run the workflow files in your repository's .codepinion/workflows/ folder: tests on every push, builds, and deploys that wait for the tests. Every key is listed in the Workflow file reference.
Your first workflow
Create .codepinion/workflows/tests.yml:
name: tests
on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
workflow_dispatch:
jobs:
test:
image: python:3.12-slim
steps:
- name: Install dependencies in the writable checkout
run: |
python -m venv .venv
.venv/bin/pip install -r requirements.txt
- name: Run tests
run: .venv/bin/pytest -v
Push it. The run appears under the repository's Actions tab.
How a job runs
- Each job runs in a container from its
image:— any public image that runs as a non-root user with uid 1000, or a short profile name:python, ornodefor a general image that has Node and Python. With noimage:the job uses the general image. - The repository is checked out before your first step, so there is no checkout step to write.
- A step is a shell command, or a mapping with
run:and an optionalname:. - Jobs run side by side unless one
needs:another.
Containers and installed tools
A job's image supplies its operating system and tools. Kubernetes pulls that image and starts a fresh container; your job does not get a Docker daemon or the node's Docker socket. Selecting an image does not grant permission to run Docker inside it.
Normal test jobs run as UID/GID 1000 with a read-only root filesystem, no privilege
escalation and all Linux capabilities dropped. The checkout at /workspace and
scratch space at /tmp are writable; HOME is /workspace. Put virtual environments,
package caches, temporary databases and build output there. Do not use sudo,
apt-get, global pip installs, or writes under /usr, /etc or /var in a normal job.
If tests need system libraries, browsers, compilers or QEMU, prepare a builder image
with those tools installed, push it to a registry, then use its digest in image:.
Install OS packages in the Dockerfile while building that image. No manual image
installation on Kubernetes nodes is needed. A private image requires operator-configured
registry pull access; listing a job secret does not authenticate Kubernetes image pulls.
The CodePinion CLI follows this pattern with themehta/codepinion-cli-builder: QEMU,
GnuPG and packaging tools are preinstalled, and its workflows pin the image digest.
Go is installed separately into the writable checkout using its checksum-verified bootstrap.
Application image builds and deploys use separate controlled profiles. Use
deploy_app: for the supported hosted-app build/deploy path; a normal test job does
not become a privileged image builder by running docker build.
See runner limits and troubleshooting for network, architecture, dependency and resource constraints.
Tags and releases today
Git tags and published releases are separate. Where your workspace has tag CI
enabled, a workflow runs for a tag push only if it declares on.push.tags (for
example tags: ["v*"]); an unfiltered on: push keeps meaning branch pushes. There
is no release event. A pushed tag never publishes a release by itself: draft and
publish it on the Releases tab. Use paths/paths-ignore to run a workflow only when
relevant files change; see the workflow reference.
Test, then deploy
needs: makes a job wait for others, and deploy_app: builds and deploys one of the repository's hosted apps. Together they ship only what passed:
on:
push:
branches: [main]
jobs:
test:
image: node
steps:
- run: npm ci
- run: npm test
ship:
needs: [test]
deploy_app: my-api
strategy:
type: blue-green
health_path: /healthz
A deploy_app: job has no steps: or image: of its own: CodePinion generates its build and deploy steps. Put your own commands in another job and depend on it.
Security checks in a pipeline
Add a security_scan: job to check each push for new leaked secrets, vulnerable dependencies and risky code. It fails only on problems the change introduces, and writes the codepinion/security check you can require before merging or deploying.
name: security
on: [push, pull_request]
jobs:
security:
security_scan:
fail_on: high
The run page shows what was found in the job's log and Summary, and the check also appears in the repository's Security → Scan history. See Security scan for every option.
Run by hand with inputs
workflow_dispatch adds a Run workflow button to the Actions tab. Declare inputs and the button asks for them:
on:
workflow_dispatch:
inputs:
target:
type: choice
options: [staging, production]
default: staging
dry_run:
type: boolean
default: "true"
jobs:
migrate:
image: python
if: inputs.dry_run != 'true'
steps:
- run: ./scripts/migrate.sh "$CP_INPUT_TARGET"
Each input reaches every step as CP_INPUT_<NAME>, upper-cased.
Reading a run
A run's page shows the jobs as a graph, and each job's Logs, a Summary, and the Failure Radar, which picks the errors out of a long log and can turn one into a task.
Write Markdown to the file named by $CP_STEP_SUMMARY and it appears on the job's Summary tab:
echo "### Coverage: 91%" >> "$CP_STEP_SUMMARY"
Secrets in a job
Store secrets under the repository's Secrets, then list the ones a job may read:
jobs:
publish:
image: node
secrets: [NPM_TOKEN]
steps:
- run: npm publish
Each listed secret arrives as an environment variable of the same name and is masked in the logs. See Secrets and variables.
Tags, releases and runner checks
When enabled by your administrator, repository Tags lists source snapshots and Releases holds draft notes and downloadable build files. Creating a tag asks you to confirm its exact commit. Version tags require a repository manager. A published release permanently protects its tag from movement or deletion; withdraw the release and publish a new version to correct it. Downloads start in your browser directly: the source ZIP/tar.gz is prepared in the background the first time (the page shows "Preparing the source archive…") and then downloads automatically.
Use on.push.tags: ["v*"] for version builds. A workflow without a tag filter,
including an unfiltered on: push, never runs for a tag push. Tag refs have CP_REF_TYPE=tag, their short name in CP_REF_NAME, and
an empty CP_BRANCH. Actions → Run workflow accepts a branch name or a full
ref such as refs/tags/v1.2.3. Different tags at the same commit are distinct runs.
In Actions, Runner capabilities & workflow check shows limits, starter YAML and read-only validation. This validates syntax and flags common compatibility issues; it does not run commands or prove that a package registry is reachable. Normal jobs have no Docker daemon, privileged mode or writable system directories. Use a prepared image for apt packages, and a project-local virtual environment for Python packages. The run details show suggested fixes when logs or pod status provide evidence of a known failure. Service containers and persistent shared caches are not available.
The configured CLI release workflow has an additional playground-first publication policy. Successful trusted builds publish to playground; production needs recorded validation, a production-specific rebuild and approval by a separate release manager.
Repository management pages share their repository lookup with their layout. Release notes and the closed AI assistant load their heavy renderers only when needed, so opening Tags does not eagerly initialize a chat panel or Markdown preview.