# Workflow directories

Most Git hosts read CI workflows from one directory only. If `.forgejo/workflows/` exists, `.github/workflows/` is skipped. Codebahn reads all four, which helps when you run CI on both Codebahn and another host, or migrate one workflow at a time.

If you are setting up CI for the first time, start with [Set up CI](/docs/set-up-ci/). This page covers where workflow files can live once you have them.

## How merging works

Codebahn scans these directories and merges the results, in order of precedence:

1. `.codebahn/workflows/` (highest)
2. `.forgejo/workflows/`
3. `.gitea/workflows/`
4. `.github/workflows/` (lowest)

Every `.yml` and `.yaml` file across these directories runs. When the same filename appears in more than one directory, the higher-precedence directory wins and the duplicates are skipped.

## Example

Given this repository:

```
.codebahn/workflows/
  deploy.yml          # Codebahn-specific deploy
.forgejo/workflows/
  deploy.yml          # skipped (same name, lower precedence)
  lint.yml            # runs
.github/workflows/
  ci.yml              # runs
  lint.yml            # skipped (same name, lower precedence)
```

Codebahn runs three workflows: `deploy.yml` from `.codebahn/`, `lint.yml` from `.forgejo/`, and `ci.yml` from `.github/`.

:::tip[Coming from GitHub?]
Your `.github/workflows/` files run as-is. You do not need to rename the directory. To override one workflow on Codebahn, add a file with the same name under `.codebahn/workflows/`. See [Migrate from GitHub](/docs/migrate-from-github/) for the full path.
:::

Merging is specific to Codebahn. Hosts that read a single directory ignore it, so if you need the same workflows to run on Codebahn and elsewhere, keep them in one directory.
