> ## Documentation Index
> Fetch the complete documentation index at: https://www.ravion.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Pipeline config file

> Pull, edit, version-control, and apply a Ravion pipeline's configuration from a single declarative YAML file checked into your repository.

Define a pipeline declaratively in `.yaml`, `.jsonc`, or `.cue`. The config file describes steps, parallel and group blocks, inputs, variants, and triggers.

<Accordion title="Example pipeline config">
  A minimal pipeline that builds and deploys the `web-app` module from the [example `ravion.yaml`](/config-as-code/project-config-file). The `build` and `deploy` steps reference the module by given ID with `environmentGivenId.moduleGivenId`. Here the `production` variant ID matches the environment given ID, so `<< pipeline.variant.id >>.web-app` resolves to `production.web-app`.

  The step `input` keys come from the module definition: the `rvn-ecs-web` build accepts `branch` and `ref`, and the deploy accepts `image_ref` (an image tag or digest, not a full URI). The deploy consumes the build's `image_digest` output, so it pins the exact image the build pushed to the module's ECR repository.

  ```yaml ravion-pipeline.yaml theme={null}
  triggers:
    - id: github_push
      type: webhook:github
      event: push
      repo: https://github.com/my-org/my-repo
      filter:
        branch: main
      run:
        production:
          input:
            branch: << trigger.payload.branch >>
            commit: << trigger.payload.commit >>
  inputs:
    - id: branch
      type: string
      default: main
    - id: commit
      type: string
      required: false
  variants:
    - id: production
      name: Production
  steps:
    - group: Build and deploy
      steps:
        - id: build_web_app
          name: Build web-app
          type: build
          module_instance: << pipeline.variant.id >>.web-app
          input:
            branch: << pipeline.input.branch >>
            ref: << pipeline.input.commit >>
        - id: deploy_web_app
          name: Deploy web-app
          type: deploy
          module_instance: << pipeline.variant.id >>.web-app
          input:
            image_ref: << steps.build_web_app.output.image_digest >>
  ```
</Accordion>

## Pull and apply

Store the config file in your repository and manage it with the CLI.

<Steps>
  <Step title="Create the pipeline, if needed">
    ```bash theme={null}
    ravion pipeline create --given-id <pipeline-id> --name "My pipeline" --project-id <project-id>
    ```
  </Step>

  <Step title="Pull the current config">
    Write the live pipeline config to a file.

    ```bash theme={null}
    ravion pipeline config pull <pipeline-id> --file pipeline.yaml
    ```
  </Step>

  <Step title="Edit the file">
    Edit the config as needed.
  </Step>

  <Step title="Apply the changes">
    Apply the config. This creates a new Pipeline Version every time.

    ```bash theme={null}
    ravion pipeline config apply <pipeline-id> --file pipeline.yaml
    ```
  </Step>

  <Step title="Integrate with CI">
    Commit the config file and let GitHub Actions plan changes on each pull request and apply them on merge.

    See [CI integration](/config-as-code/ci-integration).
  </Step>
</Steps>

## Schema reference

For every field, block, and step type, see the full reference.

<Card title="Pipeline configuration" icon="book" href="/pipelines/config-reference">
  Steps, blocks, inputs, variants, and triggers.
</Card>
