Skip to content

Commit

Permalink
add github action to deploy dbt docs
Browse files Browse the repository at this point in the history
Signed-off-by: Raphaël Courivaud <[email protected]>
  • Loading branch information
rcourivaud committed Jan 22, 2025
1 parent 40fe7a8 commit 211af4f
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/github-actions-data-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,40 @@ jobs:
alias: metabase-production
branch: main
secrets: inherit

build-and-upload-dbt-doc:
name: Build and Upload DBT Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install dbt
run: |
python -m pip install --upgrade pip
pip install dbt-core dbt-postgres
- name: Build DBT Docs
run: |
dbt docs generate
mkdir -p dbt_docs
mv target/* dbt_docs/
- name: Configure AWS CLI
env:
CELLAR_KEY_ID: ${{ secrets.CELLAR_KEY_ID }}
CELLAR_KEY_SECRET: ${{ secrets.CELLAR_KEY_SECRET }}
run: |
aws configure set aws_access_key_id $CELLAR_KEY_ID
aws configure set aws_secret_access_key $CELLAR_KEY_SECRET
- name: Upload DBT Docs to Cellar
env:
DBT_DOC_BUCKET_NAME: ${{ secrets.DBT_DOC_BUCKET_NAME }}
run: |
aws s3 sync dbt_docs/ s3://$DBT_DOC_BUCKET_NAME --acl public-read --endpoint-url https://cellar-c2.services.clever-cloud.com

0 comments on commit 211af4f

Please sign in to comment.