CI/CD with YAML files in .codeny/workflows: triggers, jobs, steps, secrets, artifacts and environments.

Workflows are YAML files in your repository's .codeny/workflows/ folder. Codeny reads them on every push, creates a run and hands the jobs to your runners.

Example#

name: CI
on:
  push:
    branches: [main, "release/*"]
  pull_request: {}
  workflow_dispatch: {}
  schedule:
    - cron: "0 3 * * *"      # daily 03:00 UTC

jobs:
  test:
    runs-on: default
    container: golang:1.24
    timeout-minutes: 20
    env:
      CGO_ENABLED: "0"
    steps:
      - name: Tests
        run: go test ./...
      - name: Build
        run: go build -o dist/app ./cmd/app
    artifacts:
      - name: app
        path: dist/app

  deploy:
    needs: [test]
    environment: production
    container: alpine:3.20
    steps:
      - run: ./scripts/deploy.sh

Triggers (on)#

TriggerStarts when …
pusha branch is pushed; optionally branches with patterns
pull_requesta pull request is opened or its source branch gets new commits
workflow_dispatchsomeone with write access starts the workflow manually (Actions tab)
schedulethe cron expression matches – in UTC, at most every 5 minutes

Jobs#

KeyMeaning
runs-onrunner label the job needs (default default)
needsjobs that must succeed first; otherwise the job is skipped
containerimage for the Docker executor; without it the runner's default image
envenvironment variables for all steps of the job
timeout-minutescancel after this time
stepssteps with name, run (shell command) and optional env
artifactsfiles or folders (name, path) uploaded after the job
environmentname of a deployment environment, e.g. production

Every run stores a copy of the workflow file. Changing the file later does not affect running runs. Invalid files show up in the Actions tab with an error message.

Environment variables in jobs#

VariableContent
CI, CODENYalways true
CODENY_REPOSITORYowner/repository
CODENY_SHAcommit of the run
CODENY_REF, CODENY_REF_NAMEfull ref and branch name
CODENY_EVENTtriggering event, e.g. push
CODENY_ACTORwho triggered the run
CODENY_RUN_NUMBER, CODENY_RUN_IDnumber and ID of the run
CODENY_JOBID of the job

The workspace contains a fresh checkout of the commit.

Secrets and variables#

Under Repository → Settings → CI/CD & keys add secrets (encrypted, no longer readable after saving) and variables. Both are available in every step as environment variables with their name, e.g. $DEPLOY_TOKEN. Names must not start with CODENY_.

Secrets are passed into every job of the repository and masked in logs – transformed values (such as base64) are not. Only run trusted code and never print secrets.

Runs, logs and artifacts#

The Actions tab lists all runs with status, jobs and steps. Logs appear live (up to 5 MiB per job). Runs can be cancelled and re-run. Artifacts are ZIP files up to 100 MiB, at most 10 per run, kept for 30 days.

Environments#

If a job has environment:, Codeny creates a deployment for that environment when the job starts and completes it with the job's result. Environments shows the history of each one.

Not available yet: matrix builds, approval rules for environments, runners at organization or instance level. At most 50 runs per repository run at the same time.

Last updated