Workflows (Actions)
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.shTriggers (on)#
| Trigger | Starts when … |
|---|---|
push | a branch is pushed; optionally branches with patterns |
pull_request | a pull request is opened or its source branch gets new commits |
workflow_dispatch | someone with write access starts the workflow manually (Actions tab) |
schedule | the cron expression matches – in UTC, at most every 5 minutes |
Jobs#
| Key | Meaning |
|---|---|
runs-on | runner label the job needs (default default) |
needs | jobs that must succeed first; otherwise the job is skipped |
container | image for the Docker executor; without it the runner's default image |
env | environment variables for all steps of the job |
timeout-minutes | cancel after this time |
steps | steps with name, run (shell command) and optional env |
artifacts | files or folders (name, path) uploaded after the job |
environment | name 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#
| Variable | Content |
|---|---|
CI, CODENY | always true |
CODENY_REPOSITORY | owner/repository |
CODENY_SHA | commit of the run |
CODENY_REF, CODENY_REF_NAME | full ref and branch name |
CODENY_EVENT | triggering event, e.g. push |
CODENY_ACTOR | who triggered the run |
CODENY_RUN_NUMBER, CODENY_RUN_ID | number and ID of the run |
CODENY_JOB | ID 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.
Was this page helpful?