Skip to content

dbt coves action

Actions
Run and schedule dbt and dbt-coves commands directly in your Github repo
v1.4.202304112229
Latest
Star (5)

ci-basic-action

A GitHub Action to run dbt <= 1.1.1 and dbt-coves commands in a Docker container. You can use dbt commands such as run, test and debug. This action captures the dbt console output for use in subsequent steps.

Supported versions

Library Version
dbt 1.1.1
dbt-coves 1.1.1a1

Usage

    - name: ci-basic-action
      uses: datacoves/ci-basic-action@master
      with:
        command: "dbt run --profiles-dir ."
      env:
        DBT_USER: ${{ secrets.DBT_USER }}
        DBT_PASSWORD: ${{ secrets.DBT_PASSWORD }}

Outputs

The result of the dbt command is either failed or passed and is saved into the result output if you want to use it in a next step:

    - name: ci-basic-action
      id: dbt-run
      uses: datacoves/ci-basic-action@master
      with:
        command: "dbt run --profiles-dir ."
      env:
        DBT_USER: ${{ secrets.DBT_USER }}
        DBT_PASSWORD: ${{ secrets.DBT_PASSWORD }}
    - name: Get the result
      if: ${{ always() }}
      run: echo "${{ steps.dbt-run.outputs.result }}"
      shell: bash

The result output is also saved in the DBT_RUN_STATE environment variable. The location of the dbt console log output can be accessed via the environment variable DBT_LOG_PATH. See the "Suggested workflow" section on how to use these.

General Setup

This action assumes that your dbt project is in the top-level directory of your repo, such as this sample dbt project. If your dbt project files are in a folder, you can specify it as such:

    - name: ci-basic-action
      uses: datacoves/ci-basic-action@master
      with:
        command: "dbt run --profiles-dir ."
        project_folder: "dbt_project"
      env:
        DBT_USER: ${{ secrets.DBT_USER }}
        DBT_PASSWORD: ${{ secrets.DBT_PASSWORD }}

Important: dbt projects use a profiles.yml file to connect to your dataset. ci-basic-action currently requires .config/profiles.yml to be in your repo unless changed using the --profiles-dir argument or the DBT_PROFILES_DIR environment variable.

Thanks

This repo was inspired on https://github.com/mwhitaker/dbt-action. Thanks to Michael Whitaker.

Suggested workflow and other tips

Here is a sample workflow that sends dbt console logs by email.

License

MIT

dbt coves action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Run and schedule dbt and dbt-coves commands directly in your Github repo
v1.4.202304112229
Latest

dbt coves action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.