Skip to content
name: Publish dbt Documentation on Release
# triggers for the workflow
on:
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
workflow_dispatch:
release:
types: [published]
permissions:
contents: write
env:
# These are configured in GitHub secrets
DBT_PROFILES_DIR: ${{ github.workspace }}/integration_test_project
DBT_ENV_SECRET_SNOWFLAKE_TEST_ACCOUNT: ${{ secrets.SNOWFLAKE_TEST_ACCOUNT }}
DBT_ENV_SECRET_SNOWFLAKE_TEST_USER: ${{ secrets.SNOWFLAKE_TEST_USER }}
DBT_ENV_SECRET_SNOWFLAKE_TEST_PASSWORD: ${{ secrets.SNOWFLAKE_TEST_PASSWORD }}
DBT_ENV_SECRET_SNOWFLAKE_TEST_ROLE: ${{ secrets.SNOWFLAKE_TEST_ROLE }}
DBT_ENV_SECRET_SNOWFLAKE_TEST_DATABASE: ${{ secrets.SNOWFLAKE_TEST_DATABASE }}
DBT_ENV_SECRET_SNOWFLAKE_TEST_WAREHOUSE: ${{ secrets.SNOWFLAKE_TEST_WAREHOUSE }}
# Env vars to test invocations model
TEST_ENV_VAR_NUMBER: 3
TEST_ENV_VAR_EMPTY: ""
TEST_ENV_VAR_WITH_QUOTE: "Triggered via Apache Airflow by task 'trigger_dbt_cloud_job_run' in the airtable_ingest DAG."
jobs:
generate-dbt-docs:
name: Generate dbt docs
runs-on: ubuntu-latest
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout Branch
uses: actions/checkout@v3
- name: Install Python packages
run: python -m pip install dbt-snowflake~=1.3.0
- name: Test database connection
run: dbt debug
- name: Install dbt packages
run: dbt deps
- name: Generate dbt docs
run: dbt docs generate
- name: Deploy to GitHub Pages
id: deployment
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: target