3 Usage actions
m.hanke edited this page 2026-10-06 06:28:52 +00:00

Actions

Cerebra's actions system is Forgejo's built-in continuous integration and delivery system. It runs automated workflows—such as building, testing, linting, deploying, or publishing software—based on events like pushes and pull requests. Workflows are defined in YAML files stored in .forgejo/workflows/ and executed by separate Forgejo Runner instances, which must be available to the repository (see Action runners).

Users familiar with GitHub Actions will recognize the overall model: workflows contain triggers, jobs, steps, runners, reusable actions, and familiar YAML concepts such as runs-on, uses, and run. Forgejo also provides compatibility features to ease reuse of existing actions and workflows, but it does not aim to be fully compatible with GitHub Actions. Migrated workflows may require adjustments, particularly for platform-specific behavior, available actions, contexts, and syntax. Forgejo can additionally look for workflows in .github/workflows/ when .forgejo/workflows/ is absent.

Secure use

The GitHub documentation provides a secure use reference that lists a number of good practices for using actions in a safe way. Most of these recommendations also apply to Cerebra's action system.

Action runners

An action runner is the worker that executes Forgejo Actions jobs. It connects to a Forgejo instance, receives eligible jobs from a workflow, runs their individual steps—such as checking out code, running tests, or building artifacts—and sends the resulting logs and status back to Forgejo. Runners are deployed separately from the Forgejo server and can be hosted on dedicated machines, virtual machines, or containers.

This is broadly equivalent to a GitHub Actions runner, especially a self-hosted one. A runner's labels determine which jobs it can accept through runs-on, allowing workflows to target environments with particular operating systems, architectures, or installed tools.

Provided action runners

Cerebra provides a generic runner service that can be used all cerebra users for small workloads. In addition, Forgejo makes it easy to register an operate custom runners for specific organizations and users (see the documentation on custom runners for more information on using, for example, batch systems to deploy runners). This is useful when specific workloads require substantial resources, or can only be executed in specific environments.

Logged in users can go to https://cerebra.fz-juelich.de/user/settings/actions/runners to see which runner are available to them.

Reusable actions

Forgejo workflows are straightforward to write in YAML and can be composed from reusable actions, keeping common tasks such as checking out code, setting up tools, or publishing artifacts out of individual workflows. Actions can be loaded from remote repositories or local directories and configured with inputs through uses and with. Creating a custom action is similarly simple: an action.yml file describes its metadata, inputs, outputs, and implementation, which can be a Node.js, Docker, or composite action. Composite actions can in turn combine existing actions and shell commands into a reusable building block.

At https://cerebra.fz-juelich.de/actions a number of reusable actions are provided that may be particularly useful for data-intensive, collaborative workflows enabled by systems like cerebra.